gh8461-005.phpt 664 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. Bug GH-8461 005 (JIT does not account for function re-compile)
  3. --EXTENSIONS--
  4. opcache
  5. --INI--
  6. opcache.enable=1
  7. opcache.enable_cli=1
  8. opcache.jit_buffer_size=1M
  9. opcache.jit=1255
  10. opcache.file_update_protection=0
  11. opcache.revalidate_freq=0
  12. opcache.protect_memory=1
  13. --FILE--
  14. <?php
  15. if (!isset(opcache_get_status()['scripts'][__DIR__ . '/gh8461-005.inc'])) {
  16. $initialRequest = true;
  17. require __DIR__ . '/gh8461-005.inc';
  18. } else {
  19. $initialRequest = false;
  20. $y = 0;
  21. function test() {
  22. global $y;
  23. $y += 1;
  24. }
  25. }
  26. for ($i = 0; $i < 10; $i++) {
  27. test();
  28. }
  29. var_dump($initialRequest ? $x : $y);
  30. print "OK";
  31. --EXPECT--
  32. int(10)
  33. OK