3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $object1 = new stdClass(); $object1->id = 1; $object1->nome = 'B'; $object2 = new stdClass(); $object2->id = 1; $object2->nome = 'A'; $dados = array($object1, $object2); var_dump($dados);
Output for 5.0.0 - 7.1.0
array(2) { [0]=> object(stdClass)#1 (2) { ["id"]=> int(1) ["nome"]=> string(1) "B" } [1]=> object(stdClass)#2 (2) { ["id"]=> int(1) ["nome"]=> string(1) "A" } }
Output for 4.3.0 - 4.4.9
array(2) { [0]=> object(stdClass)(2) { ["id"]=> int(1) ["nome"]=> string(1) "B" } [1]=> object(stdClass)(2) { ["id"]=> int(1) ["nome"]=> string(1) "A" } }