3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array('4' => 'foo', '4x' => 'bar'); $obj = (object)$arr; print_r($obj); print $obj->{4}; print $obj->{'4'};
Output for 5.5.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
stdClass Object ( [4] => foo [4x] => bar ) Notice: Undefined property: stdClass::$4 in /in/rsfIv on line 8 Notice: Undefined property: stdClass::$4 in /in/rsfIv on line 9
Output for 5.0.0 - 5.4.45
stdClass Object ( [4] => foo [4x] => bar )
Output for 4.3.3 - 4.4.9
<br /> <b>Fatal error</b>: Property name must be a string in <b>/in/rsfIv</b> on line <b>8</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.2
stdClass Object ( [4] => foo [4x] => bar )
Process exited with code 139.