3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a; private $b; public function __construct($a) { $this->a = $a; $this->b = $a; } public function __sleep() { return array('a'); } public function __wakeUp() { $this->__construct($this->a); } public function getA() { return $this->a; } public function getB() { return $this->b; } } $a = new A('a'); $serialized = serialize($a); $unserialized = unserialize($serialized); var_dump($serialized); var_dump($unserialized); var_dump($unserialized->getA()); var_dump($unserialized->getB());
Output for git.master, git.master_jit, rfc.property-hooks
string(31) "O:1:"A":1:{s:4:"Aa";s:1:"a";}" object(A)#2 (2) { ["a":"A":private]=> string(1) "a" ["b":"A":private]=> string(1) "a" } string(1) "a" 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:
43.86 ms | 401 KiB | 8 Q