3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $p = 2778845; $d = (object)[2778845 => 'test']; var_dump($d); var_dump($d->{2778845});
based on a5EcA
Output for 7.2.0
object(stdClass)#1 (1) { ["2778845"]=> string(4) "test" } string(4) "test"
Output for 5.4.11 - 7.1.10
object(stdClass)#1 (1) { [2778845]=> string(4) "test" } Notice: Undefined property: stdClass::$2778845 in /in/lQ3b2 on line 7 NULL
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/lQ3b2 on line 5
Process exited with code 255.