bug72038.phpt 472 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice)
  3. --FILE--
  4. <?php
  5. test($foo = new stdClass);
  6. var_dump($foo);
  7. test($bar = 2);
  8. var_dump($bar);
  9. test($baz = &$bar);
  10. var_dump($baz);
  11. function test(&$param) {
  12. $param = 1;
  13. }
  14. ?>
  15. --EXPECTF--
  16. Notice: Only variables should be passed by reference in %s on line %d
  17. object(stdClass)#1 (0) {
  18. }
  19. Notice: Only variables should be passed by reference in %s on line %d
  20. int(2)
  21. int(1)