php-src/Zend/tests/bug73753.phpt
2016-12-21 21:18:20 +01:00

30 lines
492 B
PHP

--TEST--
Bug #73753 Non packed arrays and duplication
--FILE--
<?php
function iterate($current, $a, $result = null) {
if (!$current) {
return $result;
}
return iterate(getNext($a), $a, $current);
}
function getNext(&$a) {
return next($a);
}
function getCurrent($a) {
return current($a);
}
function traverse($a) {
return iterate(getCurrent($a), $a);
}
$arr = array(1 => 'foo', 'b' => 'bar', 'baz');
var_dump(traverse($arr));
?>
--EXPECTF--
string(3) "baz"