3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar = '120'; public function __sleep() { return [$this->bar, 240]; } } $obj = new Foo(); echo serialize($obj);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: serialize(): "120" returned as member variable from __sleep() but does not exist in /in/NaTIv on line 14 Warning: serialize(): Foo::__sleep() should return an array only containing the names of instance-variables to serialize in /in/NaTIv on line 14 Warning: serialize(): "240" returned as member variable from __sleep() but does not exist in /in/NaTIv on line 14 O:3:"Foo":0:{}

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:
45.41 ms | 402 KiB | 8 Q