3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $obj = new stdClass(); $obj->name1->name2 = 'value2'; $param2 = 'name1->name2'; $result = $obj; foreach( explode( '->', $param2) as $var) { $result = $result->$var; } echo $result;
Output for 5.4.0 - 7.1.0
Warning: Creating default object from empty value in /in/iGJBK on line 4 value2
Output for 5.0.0 - 5.3.29
Strict Standards: Creating default object from empty value in /in/iGJBK on line 4 value2
Output for 4.3.0 - 4.4.9
value2