3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $kids = [ ['firstname' => 'Pat', 'surname' => 'Don', 'age' => 10 ], ['firstname' => 'Kat', 'surname' => 'Munn', 'age' => 12 ], ['firstname' => 'Dee', 'surname' => 'Ken', 'age' => 8 ] ]; $newKids = []; foreach($kids as $kid) { $newKids[] = (object) $kid; } var_dump($newKids[0]); // error: Undefined property: stdClass::$0
based on SgeYT
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
object(stdClass)#1 (3) { ["firstname"]=> string(3) "Pat" ["surname"]=> string(3) "Don" ["age"]=> int(10) }