3v4l.org

run code in 300+ PHP versions simultaneously
<?php function tescik(ArrayObject $ao) { //$ao['foo2'] = 'kaboom'; throw new Exception('kaboom'); } $obj = new ArrayObject(array('foo1' => 'bar1', 'foo2' => 'bar2'), ArrayObject::ARRAY_AS_PROPS); echo "\n\n"; echo "before:"; var_dump($obj); $obj2 = clone $obj; try { $obj2 = tescik($obj2); } catch(Exception $e) { } echo "after:"; var_dump($obj2); echo "\n\n";
Output for git.master, git.master_jit, rfc.property-hooks
before:object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(2) { ["foo1"]=> string(4) "bar1" ["foo2"]=> string(4) "bar2" } } after:object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> array(2) { ["foo1"]=> string(4) "bar1" ["foo2"]=> string(4) "bar2" } }

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