3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /* $o = new stdClass; $id = -99; $a = array('id' => $id, 'name' => 'bill'); $o->$id = $a; var_export($o); */ $o = (object) array(-99 => array('id' => $id, 'name' => 'bill')); var_export($o);
Output for 5.2.9 - 5.2.13, 5.3.0 - 5.3.2, 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: id in /in/vIXc2 on line 9 stdClass::__set_state(array( -99 => array ( 'id' => NULL, 'name' => 'bill', ), ))
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: id in /in/vIXc2 on line 9 stdClass::__set_state(array( -99 => array ( 'id' => NULL, 'name' => 'bill', ), ))
Output for 5.2.14 - 5.2.17, 5.3.3 - 5.3.29
Notice: Undefined variable: id in /in/vIXc2 on line 9 stdClass::__set_state(array( 18446744073709551517 => array ( 'id' => NULL, 'name' => 'bill', ), ))
Output for 5.1.0 - 5.2.8
Notice: Undefined variable: id in /in/vIXc2 on line 9 stdClass::__set_state(array( ))
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: id in /in/vIXc2 on line 9 class stdClass { }
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: id in /in/vIXc2 on line 9 class stdClass { }