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' => -99, '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
stdClass::__set_state(array( -99 => array ( 'id' => -99, 'name' => 'bill', ), ))
Output for hhvm-3.10.0 - 3.12.0
stdClass::__set_state(array( -99 => array ( 'id' => -99, 'name' => 'bill', ), ))
Output for 5.2.14 - 5.2.17, 5.3.3 - 5.3.29
stdClass::__set_state(array( 18446744073709551517 => array ( 'id' => -99, 'name' => 'bill', ), ))
Output for 5.1.0 - 5.2.8
stdClass::__set_state(array( ))
Output for 4.3.0 - 5.0.5
class stdClass { }