assign_053.phpt 607 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. JIT ASSIGN: memory leak
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.file_update_protection=0
  7. opcache.jit_buffer_size=1M
  8. opcache.protect_memory=1
  9. --FILE--
  10. <?php
  11. class Test {
  12. public string $x;
  13. }
  14. $test=new Test;
  15. $test->x = " $y ";
  16. $r = &$test->x + ($r = $y);
  17. ?>
  18. --EXPECTF--
  19. Warning: Undefined variable $y in %sassign_053.php on line 6
  20. Warning: Undefined variable $y in %sassign_053.php on line 7
  21. Fatal error: Uncaught TypeError: Cannot assign null to reference held by property Test::$x of type string in %sassign_053.php:7
  22. Stack trace:
  23. #0 {main}
  24. thrown in %sassign_053.php on line 7