Last active
August 29, 2015 14:04
-
-
Save sun/180f508862b30b6cb973 to your computer and use it in GitHub Desktop.
Revisions
-
sun revised this gist
Jul 30, 2014 . 2 changed files with 18 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,7 @@ } } // Also note that 'two' gets re-keyed to 0 (but that seems to be expected behavior). $expected = array('two'); echo "-- Actual result:\n", var_dump($list), "\n"; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ $ php bug.php -- Actual result: class SplDoublyLinkedList#1 (2) { private $flags => int(2) private $dllist => array(1) { [0] => string(3) "one" } } -- Expected result: array(1) { [0] => string(3) "two" } -
sun created this gist
Jul 30, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ <?php $list = new SplDoublyLinkedList(); // Comment this out to make it behave. $list->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); $list->push('one'); $list->push('two'); foreach ($list as $key => $value) { if ($value === 'one') { unset($list[$key]); } } $expected = array('two'); echo "-- Actual result:\n", var_dump($list), "\n"; echo "-- Expected result:\n", var_dump($expected), "\n";