3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $obj = new stdClass(); $obj->{'456'} = "foo"; $obj->{123} = "bar"; $obj->{true} = "true"; $obj->789 = "foobar"; $arr = (array)$obj; var_dump($arr); var_dump($arr['123'], $arr[123]); var_dump($arr['456'], $arr[456]);
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected '789' (T_LNUMBER), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/JRbbn on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_LNUMBER, expecting T_STRING or T_VARIABLE or '{' or '$' in /in/JRbbn on line 7
Process exited with code 255.