3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test implements Serializable { private $foo = "Test"; public function __serialize(): array { return [ 'foo' => $this->foo ]; } public function __unserialize( array $data ): void { $this->foo = $data['foo']; } public function serialize() { return serialize( $this->__serialize() ); } public function unserialize( $serialized ): void { $this->__unserialize( unserialize( $serialized ) ); } } echo serialize(new Test()) . "\n"; // PHP 7.00 - 7.3.33 echo get_class(unserialize('C:4:"Test":27:{a:1:{s:3:"foo";s:4:"Test";}}')) . "\n"; // PHP 7.4.0 - 8.1.9 echo get_class(unserialize('O:4:"Test":1:{s:3:"foo";s:4:"Test";}')) . "\n";
Output for git.master, git.master_jit, rfc.property-hooks
O:4:"Test":1:{s:3:"foo";s:4:"Test";} Test Test

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:
64.9 ms | 401 KiB | 8 Q