3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = new \stdClass(); $d->asdf = new \stdClass(); var_dump(empty($d->asd)); var_dump(isset($d->asdf[0]));
Output for 7.0.0 - 7.1.0
bool(true) Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/LIn9l:6 Stack trace: #0 {main} thrown in /in/LIn9l on line 6
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
bool(true) Fatal error: Object does not implement ArrayAccess in /in/LIn9l on line 6
Process exited with code 255.
Output for 5.3.0 - 5.6.28
bool(true) Fatal error: Cannot use object of type stdClass as array in /in/LIn9l on line 6
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/LIn9l on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/LIn9l on line 4 bool(true) Fatal error: Cannot use object of type stdClass as array in /in/LIn9l on line 6
Process exited with code 255.
Output for 4.3.0 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/LIn9l on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/LIn9l on line 4 bool(true) bool(false)