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

1.1       misho       1: --TEST--
                      2: Test array_push() function : usage variations - position of internal array pointer
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : int array_push(array $stack, mixed $var [, mixed $...])
                      6:  * Description: Pushes elements onto the end of the array 
                      7:  * Source code: ext/standard/array.c
                      8:  */
                      9: 
                     10: /*
                     11:  * Check the position of the internal array pointer after calling array_push()
                     12:  */
                     13: 
                     14: echo "*** Testing array_push() : usage variations ***\n";
                     15: 
                     16: $stack = array ('one' => 'un', 'two' => 'deux');
                     17: $var0 = 'zero';
                     18: 
                     19: echo "\n-- Call array_push() --\n";
                     20: var_dump($result = array_push($stack, $var0));
                     21: 
                     22: echo "\n-- Position of Internal Pointer in Original Array: --\n";
                     23: echo key($stack) . " => " . current ($stack) . "\n";
                     24: 
                     25: echo "Done";
                     26: ?>
                     27: --EXPECTF--
                     28: 
                     29: *** Testing array_push() : usage variations ***
                     30: 
                     31: -- Call array_push() --
                     32: int(3)
                     33: 
                     34: -- Position of Internal Pointer in Original Array: --
                     35: one => un
                     36: Done

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