3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( '0'=> (Object) array( 'ID'=>1, 'name'=> 'firstname' ), '1'=> (Object) array( 'ID'=>2, 'name'=>'secondname' ), '2'=>(Object)array( 'ID'=>3, 'name'=>'thirdname' ) ); foreach($a as $object){ echo $object->name; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
160.54 ms | 2261 KiB | 9 Q