3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arraykey = new stdClass; $arraykey[0]->date = "2008-05-20"; $arraykey[0]->page_views = 1; $arraykey[1]->date = "2011-08-03"; $arraykey[1]->page_views = 1; $arraykey[2]->date = 2008-08-20; $arraykey[2]->page_views = 1; $arraykey->date = 2008-08-27; $arraykey->page_views = 1; $arraykey->date = "2011-10-11"; $arraykey->page_views = 1; print_r($arraykey);
Output for 5.0.0 - 5.4.17
Fatal error: Cannot use object of type stdClass as array in /in/nAfaA on line 4
Process exited with code 255.
Output for 4.3.0 - 4.4.9
Warning: Cannot use a scalar value as an array in /in/nAfaA on line 4 Warning: Cannot use a scalar value as an array in /in/nAfaA on line 5 Warning: Cannot use a scalar value as an array in /in/nAfaA on line 6 Warning: Cannot use a scalar value as an array in /in/nAfaA on line 7 Warning: Cannot use a scalar value as an array in /in/nAfaA on line 8 Warning: Cannot use a scalar value as an array in /in/nAfaA on line 9 stdClass Object ( [date] => 2011-10-11 [page_views] => 1 )