3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = new stdClass(); $array = array('test'=>'test_prop'); foreach ($array as $name => $prop){ $test->$array[$name] = 'SET!'; } print_r($test);

preferences:
47.85 ms | 402 KiB | 5 Q