php-src/ext/standard/tests/array/next_basic.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

35 lines
768 B
PHP

--TEST--
Test next() function : basic functionality
--FILE--
<?php
/* Prototype : mixed next(array $array_arg)
* Description: Move array argument's internal pointer to the next element and return it
* Source code: ext/standard/array.c
*/
/*
* Test basic functionality of next()
*/
echo "*** Testing next() : basic functionality ***\n";
$array = array('zero', 'one', 'two');
echo key($array) . " => " . current($array) . "\n";
var_dump(next($array));
echo key($array) . " => " . current($array) . "\n";
var_dump(next($array));
echo key($array) . " => " . current($array) . "\n";
var_dump(next($array));
?>
===DONE===
--EXPECT--
*** Testing next() : basic functionality ***
0 => zero
string(3) "one"
1 => one
string(3) "two"
2 => two
bool(false)
===DONE===