3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo1 = new stdClass(); $foo1->bar = 'test1'; $foo1->baz = 'test2'; $foo2 = new stdClass(); $foo2->baz = 'test2'; $foo2->bar = 'test1'; var_dump($foo1); var_dump(serialize($foo1)); var_dump($foo2); var_dump(serialize($foo2));
Output for 5.0.0 - 7.1.0
object(stdClass)#1 (2) { ["bar"]=> string(5) "test1" ["baz"]=> string(5) "test2" } string(63) "O:8:"stdClass":2:{s:3:"bar";s:5:"test1";s:3:"baz";s:5:"test2";}" object(stdClass)#2 (2) { ["baz"]=> string(5) "test2" ["bar"]=> string(5) "test1" } string(63) "O:8:"stdClass":2:{s:3:"baz";s:5:"test2";s:3:"bar";s:5:"test1";}"
Output for 4.3.0 - 4.4.9
object(stdClass)(2) { ["bar"]=> string(5) "test1" ["baz"]=> string(5) "test2" } string(63) "O:8:"stdClass":2:{s:3:"bar";s:5:"test1";s:3:"baz";s:5:"test2";}" object(stdClass)(2) { ["baz"]=> string(5) "test2" ["bar"]=> string(5) "test1" } string(63) "O:8:"stdClass":2:{s:3:"baz";s:5:"test2";s:3:"bar";s:5:"test1";}"