|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-01-19 14:58 UTC] nikic@php.net
-Status: Open
+Status: Verified
-Assigned To:
+Assigned To: dmitry
[2021-01-19 14:58 UTC] nikic@php.net
[2021-01-20 08:04 UTC] dmitry@php.net
[2021-01-20 08:04 UTC] dmitry@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 04:00:01 2025 UTC |
Description: ------------ When a class which extends an internal class is preloaded and JIT-compiled, the internal class' write_property handler doesn't get executed. Without preloading it works correctly. This requires quite an exotic test case to reproduce. While the test case itself doesn't make any sense, it's a case that I've encountered while updating an extension with real code, and I spent some time to create a reproducing test case only using PHP's own builtin classes to ensure that it wasn't some crazy bug in my extension. Command line is `php -dopcache.enable_cli=1 -dopcache.jit=1205 -dopcache.preload=preload.php test.php` Test script: --------------- preload.php: <?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); } } test.php: <?php $v = new SomeClass(5); Expected result: ---------------- (this output is produced without preloading or JIT) PHP Fatal error: Uncaught Error: Writing to DatePeriod->interval is unsupported in /home/user/pocketmine-mp/preload.php:8 Stack trace: #0 /home/user/pocketmine-mp/test.php(3): SomeClass->__construct() #1 {main} thrown in /home/user/pocketmine-mp/preload.php on line 8 Actual result: -------------- int(5)