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);
Output for 5.1.0 - 7.1.0
stdClass::__set_state(array( '-99' => array ( 'id' => -99, 'name' => 'bill', ), ))
Output for 5.0.0 - 5.0.5
class stdClass { public $-99 = array ( 'id' => -99, 'name' => 'bill', ); }
Output for 4.3.3 - 4.4.9
class stdClass { }
Output for 4.3.0 - 4.3.2
class stdClass { var $-99 = array ( 'id' => -99, 'name' => 'bill', ); }