3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump((object) array('' => 'a', 1, 2) );
based on rlJpD
Output for 5.1.0 - 5.1.6, 5.6.21 - 5.6.28, 7.0.6 - 7.1.0
object(stdClass)#1 (3) { [""]=> string(1) "a" [0]=> int(1) [1]=> int(2) }
Output for 7.0.0 - 7.0.5
object(stdClass)#1 (3) { Notice: Illegal member variable name in /in/tcMha on line 3 [""]=> string(1) "a" [0]=> int(1) [1]=> int(2) }
Output for 5.2.0 - 5.6.20
object(stdClass)#1 (3) { Notice: Illegal member variable name in /in/tcMha on line 5 [""]=> string(1) "a" [0]=> int(1) [1]=> int(2) }
Output for 5.0.0 - 5.0.5
object(stdClass)#1 (3) { [":private"]=> string(1) "a" [0]=> int(1) [1]=> int(2) }
Output for 4.3.0 - 4.4.9
object(stdClass)(3) { [""]=> string(1) "a" [0]=> int(1) [1]=> int(2) }