Skip to content

Commit

Permalink
Merge pull request #1 from HeKunTong/master
Browse files Browse the repository at this point in the history
1.flush清空数据修复 2.loadArray 增加链接 3.toXML 判断写错
  • Loading branch information
kiss291323003 authored Apr 12, 2019
2 parents 2848daa + a33571f commit 1f3afb0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/SplArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public function values(): SplArray

public function flush():SplArray
{
foreach ($this as $key => $item){
foreach ($this->getArrayCopy() as $key => $item){
unset($this[$key]);
}
return $this;
Expand All @@ -230,6 +230,7 @@ public function flush():SplArray
public function loadArray(array $data)
{
parent::__construct($data);
return $this;
}

/*
Expand Down Expand Up @@ -269,7 +270,7 @@ public function addCData($cdata_text) {
}
$parser($ch,$v);
} else {
if (is_numeric($v)){
if (is_numeric($k)){
$xml->addChild($k, $v);
}else{
if($CD_DATA){
Expand Down

0 comments on commit 1f3afb0

Please sign in to comment.