3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $null = null; $x = array( $null => 'null', 0 => 0, ); var_dump((object)$x); var_dump($x[":private"]);
Output for 5.6.21 - 5.6.28, hhvm-3.12.0, 7.0.6 - 7.1.0
object(stdClass)#1 (2) { [""]=> string(4) "null" [0]=> int(0) } Notice: Undefined index: :private in /in/kmXBA on line 10 NULL
Output for 5.3.0 - 5.6.20, 7.0.0 - 7.0.5
object(stdClass)#1 (2) { Notice: Illegal member variable name in /in/kmXBA on line 8 [""]=> string(4) "null" [0]=> int(0) } Notice: Undefined index: :private in /in/kmXBA on line 10 NULL
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.2.0 - 5.2.17
object(stdClass)#1 (2) { Notice: Illegal member variable name in /in/kmXBA on line 8 [""]=> string(4) "null" [0]=> int(0) } Notice: Undefined index: :private in /in/kmXBA on line 10 NULL
Output for 5.1.0 - 5.1.6
object(stdClass)#1 (2) { [""]=> string(4) "null" [0]=> int(0) } Notice: Undefined index: :private in /in/kmXBA on line 10 NULL
Output for 5.0.0 - 5.0.5
object(stdClass)#1 (2) { [":private"]=> string(4) "null" [0]=> int(0) } Notice: Undefined index: :private in /in/kmXBA on line 10 NULL
Output for 4.3.0 - 4.4.9
object(stdClass)(2) { [""]=> string(4) "null" [0]=> int(0) } Notice: Undefined index: :private in /in/kmXBA on line 10 NULL