3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array('foo' => "bar"); $obj = new stdClass; $obj->foo = "bar"; $arr->foo; $obj['foo'];
based on Sp8SL
Output for 7.0.0 - 7.1.0
Notice: Trying to get property of non-object in /in/Od67O on line 7 Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/Od67O:9 Stack trace: #0 {main} thrown in /in/Od67O on line 9
Process exited with code 255.
Output for hhvm-3.12.0
Notice: Cannot access property on non-object in /in/Od67O on line 7 Fatal error: Object does not implement ArrayAccess in /in/Od67O on line 9
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.6.28
Notice: Trying to get property of non-object in /in/Od67O on line 7 Fatal error: Cannot use object of type stdClass as array in /in/Od67O on line 9
Process exited with code 255.
Output for 4.3.0 - 4.4.9