3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = new stdClass(); $array = array('test'=>'test_prop'); foreach ($array as $name => $prop){ $test->$array[$name] = 'SET!'; } print_r($test);
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/LIHLR on line 5 stdClass Object ( [Array] => Array ( [test] => SET! ) )
Output for 5.3.21 - 5.6.28
stdClass Object ( [test_prop] => SET! )