Annotation of embedaddon/php/ext/standard/tests/array/prev_error2.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: prev - ensure warning is received when passing an indirect temporary.
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : mixed prev(array $array_arg)
! 6: * Description: Move array argument's internal pointer to the previous element and return it
! 7: * Source code: ext/standard/array.c
! 8: */
! 9:
! 10: /*
! 11: * Pass temporary variables to prev() to test behaviour
! 12: */
! 13:
! 14: function f() {
! 15: $array = array(1,2);
! 16: end($array);
! 17: return $array;
! 18: }
! 19:
! 20: echo "\n-- Passing an indirect temporary variable --\n";
! 21: var_dump(prev(f()));
! 22:
! 23: ?>
! 24: --EXPECTF--
! 25: -- Passing an indirect temporary variable --
! 26:
! 27: Strict Standards: Only variables should be passed by reference in %s on line %d
! 28: int(1)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>