diff options
author | Dmitry Stogov <dmitry@zend.com> | 2021-01-20 11:04:30 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2021-01-20 11:04:30 +0300 |
commit | 378f870d7c2b9f473fd340fd8aaebd7c5ca0d6db (patch) | |
tree | 3e6995192ba92561a3d3c30fdc0e2b9ef7074ebd /ext/opcache/tests/jit | |
parent | d8c785b894e1a4ed9793d71cad02330cb0034faa (diff) | |
parent | 6288228b566db29637e041ffd6392d9895d4d223 (diff) | |
download | php-git-378f870d7c2b9f473fd340fd8aaebd7c5ca0d6db.tar.gz |
Merge branch 'PHP-8.0'
* PHP-8.0:
Fixed bug #80634 (write_property handler of internal classes is skipped on preloaded JITted code)
Diffstat (limited to 'ext/opcache/tests/jit')
-rw-r--r-- | ext/opcache/tests/jit/bug80634.phpt | 22 | ||||
-rw-r--r-- | ext/opcache/tests/jit/preload_bug80634.inc | 10 |
2 files changed, 32 insertions, 0 deletions
diff --git a/ext/opcache/tests/jit/bug80634.phpt b/ext/opcache/tests/jit/bug80634.phpt new file mode 100644 index 0000000000..579adda0e3 --- /dev/null +++ b/ext/opcache/tests/jit/bug80634.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #80634 (write_property handler of internal classes is skipped on preloaded JITted code) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +opcache.protect_memory=1 +opcache.jit=function +opcache.preload={PWD}/preload_bug80634.inc +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +$v = new SomeClass(5); +?> +--EXPECTF-- +Fatal error: Uncaught Error: Writing to DatePeriod->interval is unsupported in %spreload_bug80634.inc:7 +Stack trace: +#0 %sbug80634.php(2): SomeClass->__construct(5) +#1 {main} + thrown in %spreload_bug80634.inc on line 7
\ No newline at end of file diff --git a/ext/opcache/tests/jit/preload_bug80634.inc b/ext/opcache/tests/jit/preload_bug80634.inc new file mode 100644 index 0000000000..feee9ec970 --- /dev/null +++ b/ext/opcache/tests/jit/preload_bug80634.inc @@ -0,0 +1,10 @@ +<?php +class SomeClass extends \DatePeriod { + public $interval; + + public function __construct(int $v) { + parent::__construct(new \DateTime('2020-12-31'), new \DateInterval("P1Y"), 1); + $this->interval = $v; + var_dump($this->interval); + } +}
\ No newline at end of file |