3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* // Original definition readonly class Foo { public function __construct(private string $a) {} } var_dump(bin2hex(serialize(new Foo("foo")))); // 4f3a333a22466f6f223a313a7b733a363a2200466f6f0061223b733a333a22666f6f223b7d */ // New definition, 'a' is no longer required. readonly class Foo { public function __construct() {} } var_dump(unserialize(hex2bin('4f3a333a22466f6f223a313a7b733a363a2200466f6f0061223b733a333a22666f6f223b7d')));
Output for git.master_jit, git.master
Fatal error: Uncaught Error: Cannot create dynamic property Foo::$a in /in/Xsmfu:18 Stack trace: #0 /in/Xsmfu(18): unserialize('O:3:"Foo":1:{s:...') #1 {main} thrown in /in/Xsmfu on line 18
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
56.47 ms | 405 KiB | 5 Q