028.phpt 326 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Test nullsafe in sub-chain of return as ref
  3. --FILE--
  4. <?php
  5. function &returns_ref($unused) {
  6. global $foo;
  7. return $foo;
  8. }
  9. function &returns_ref2() {
  10. $null = null;
  11. return returns_ref($null?->null);
  12. }
  13. global $foo;
  14. $foo2 = &returns_ref2();
  15. $foo2 = 'foo';
  16. var_dump($foo);
  17. ?>
  18. --EXPECT--
  19. string(3) "foo"