3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array('123' => '456'); $obj = (object)$arr; $arr = (array)$obj; var_dump($arr, $arr['123']); var_dump($obj, $obj->{'123'});
based on nLE4G
Output for 5.2.6 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(1) { [123]=> string(3) "456" } string(3) "456" Notice: Undefined property: stdClass::$123 in /in/0nSt6 on line 8 object(stdClass)#1 (1) { [123]=> string(3) "456" } NULL
Output for 5.0.0 - 5.2.5
array(1) { [123]=> string(3) "456" } string(3) "456" Notice: Undefined property: stdClass::$123 in /in/0nSt6 on line 8 object(stdClass)#1 (1) { [123]=> string(3) "456" } NULL
Output for 4.3.0 - 4.4.9
array(1) { [123]=> string(3) "456" } string(3) "456" object(stdClass)(1) { [123]=> string(3) "456" } string(3) "456"