bug80802.phpt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. --TEST--
  2. Bug #80802: zend_jit_fetch_indirect_var assert failure with tracing JIT
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.jit_buffer_size=1M
  7. opcache.jit=tracing
  8. --EXTENSIONS--
  9. opcache
  10. --FILE--
  11. <?php
  12. abstract class AsyncTask{
  13. private static $threadLocalStorage = null;
  14. protected function storeLocal(string $key, $complexData) : void{
  15. if(self::$threadLocalStorage === null){
  16. self::$threadLocalStorage = new \ArrayObject();
  17. }
  18. self::$threadLocalStorage[spl_object_id($this)][$key] = $complexData;
  19. }
  20. final public function __destruct(){
  21. $this->reallyDestruct();
  22. if(self::$threadLocalStorage !== null and isset(self::$threadLocalStorage[$h = spl_object_id($this)])){
  23. unset(self::$threadLocalStorage[$h]);
  24. if(self::$threadLocalStorage->count() === 0){
  25. self::$threadLocalStorage = null;
  26. }
  27. }
  28. }
  29. protected function reallyDestruct() : void{
  30. }
  31. }
  32. class Task extends AsyncTask{
  33. public function __construct(){
  34. $this->storeLocal("thing1", new stdClass);
  35. }
  36. }
  37. for($i = 0; $i < 10000; ++$i){
  38. new Task;
  39. }
  40. echo "OK\n";
  41. ?>
  42. --EXPECT--
  43. OK