assign_ref_func_leak.phpt 325 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Assigning the result of a non-reference function by-reference should not leak
  3. --FILE--
  4. <?php
  5. function func() {
  6. return [0];
  7. }
  8. $x = $y =& func();
  9. var_dump($x, $y);
  10. ?>
  11. --EXPECTF--
  12. Notice: Only variables should be assigned by reference in %s on line %d
  13. array(1) {
  14. [0]=>
  15. int(0)
  16. }
  17. array(1) {
  18. [0]=>
  19. int(0)
  20. }