3v4l.org

run code in 500+ PHP versions simultaneously
<?php class ReadonlyWakeup { public function __construct(public readonly string $value) {} public function __wakeup(): void { $this->value = 'set on wakeup'; } } $obj = new ReadonlyWakeup('test'); $serialized = serialize($obj); $unserialized = unserialize($serialized); print $unserialized->value;
Output for git.master_jit, git.master
Fatal error: Uncaught Error: Cannot modify readonly property ReadonlyWakeup::$value in /in/OPTLj:7 Stack trace: #0 [internal function]: ReadonlyWakeup->__wakeup() #1 /in/OPTLj(13): unserialize('O:14:"ReadonlyW...') #2 {main} thrown in /in/OPTLj on line 7
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:
44.8 ms | 716 KiB | 4 Q