3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A extends SplObjectStorage { protected $a = null; public function __construct() { $this->a = '123'; } public function getA() { return $this->a; } } $serialized = serialize(new A()); $obj = unserialize($serialized); $reader = function & ($object, $property) { $value = & \Closure::bind(function & () use ($property) { return $this->$property; }, $object, $object)->__invoke(); return $value; }; $test3 = & $reader($obj, 'a'); echo "Result from Getter\n"; var_dump($obj->getA()); echo "Result from Reflection\n"; var_Dump($test3); echo "This is the deserialized Object\n"; var_Dump($obj);
Output for git.master, git.master_jit, rfc.property-hooks
Result from Getter string(3) "123" Result from Reflection string(3) "123" This is the deserialized Object object(A)#1 (2) { ["a":protected]=> &string(3) "123" ["storage":"SplObjectStorage":private]=> array(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:
35.27 ms | 401 KiB | 8 Q