php-src/Zend/tests/bug73753.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

30 lines
491 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));
?>
--EXPECT--
string(3) "baz"