3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = new stdClass; $a->a = new stdClass; $a->a->a = new stdClass; $a->a->a->a = 'a'; $a = [ 'a' => [ 'a' => [ 'a' => 'a' ] ] ]; $b = $a->a; var_dump($b); var_dump($b['a'] = 'c'); var_dump($a);

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
Notice: Trying to get property 'a' of non-object in /in/CZkRP on line 12 NULL string(1) "c" array(1) { ["a"]=> array(1) { ["a"]=> array(1) { ["a"]=> string(1) "a" } } }
Output for Arrow functions
Notice: Trying to get property of non-object in /in/CZkRP on line 12 NULL string(1) "c" array(1) { ["a"]=> array(1) { ["a"]=> array(1) { ["a"]=> string(1) "a" } } }
Output for Object typehint
Notice: Trying to get property of non-object in /in/CZkRP on line 12 NULL string(1) "c" array(1) { ["a"]=> array(1) { ["a"]=> array(1) { ["a"]=> string(1) "a" } } }
Output for Array change keys
Notice: Trying to get property of non-object in /in/CZkRP on line 12 NULL string(1) "c" array(1) { ["a"]=> array(1) { ["a"]=> array(1) { ["a"]=> string(1) "a" } } }
Output for Lexical anon
Notice: Trying to get property of non-object in /in/CZkRP on line 12 NULL string(1) "c" array(1) { ["a"]=> array(1) { ["a"]=> array(1) { ["a"]=> string(1) "a" } } }

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