Annotation of embedaddon/php/ext/standard/tests/array/reset_variation2.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test reset() function : usage variations - unset first element
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : mixed reset(array $array_arg)
                      6:  * Description: Set array argument's internal pointer to the first element and return it 
                      7:  * Source code: ext/standard/array.c
                      8:  */
                      9: 
                     10: /*
                     11:  * Unset first element of an array and test behaviour of reset()
                     12:  */
                     13: 
                     14: echo "*** Testing reset() : usage variations ***\n";
                     15: 
                     16: $array = array('a', 'b', 'c');
                     17: 
                     18: echo "\n-- Initial Position: --\n";
                     19: echo current($array) . " => " . key($array) . "\n";
                     20: 
                     21: echo "\n-- Unset First element in array and check reset() --\n";
                     22: unset($array[0]);
                     23: var_dump(reset($array));
                     24: ?>
                     25: ===DONE===
                     26: --EXPECTF--
                     27: *** Testing reset() : usage variations ***
                     28: 
                     29: -- Initial Position: --
                     30: a => 0
                     31: 
                     32: -- Unset First element in array and check reset() --
                     33: string(1) "b"
                     34: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>