passByReference_012.phpt 620 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Test pass by reference semantics
  3. --FILE--
  4. <?php
  5. // Simplified array_shift_variation5.phpt
  6. // Showing warning:
  7. // "Only variables should be passed by reference in %s on line %d"
  8. $stack = array ( array ( 'two' ));
  9. var_dump(array_shift(array_shift($stack)));
  10. // This should show the identical warning
  11. $original = array ( array ( 'one' ));
  12. $stack = $original;
  13. var_dump(array_shift(array_shift($stack)));
  14. ?>
  15. ===DONE===
  16. --EXPECTF--
  17. Notice: Only variables should be passed by reference in %s on line %d
  18. string(3) "two"
  19. Notice: Only variables should be passed by reference in %s on line %d
  20. string(3) "one"
  21. ===DONE===