3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct ( private readonly string $value ) {} public function getValue() { return $this->value; } } class_alias('A', 'B'); $x = 'O:1:"B":2:{s:8:"' . "\0" . 'A' . "\0" . 'value";s:1:"a";s:8:"' . "\0" . 'B' . "\0" . 'value";s:1:"b";}'; $obj = unserialize($x); var_dump( $obj, $obj->getValue() );
Output for git.master_jit, git.master
Deprecated: Creation of dynamic property A::$value is deprecated in /in/Zp82B on line 14 object(A)#1 (2) { ["value":"A":private]=> string(1) "a" ["value":"B":private]=> string(1) "b" } string(1) "a"

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:
35.61 ms | 405 KiB | 5 Q