Return to prev_error2.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array |
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)