3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
// PHP 5.0 or later: $array = []; var_dump(empty($array)); // outputs bool(true) $array = new ArrayObject(); var_dump(empty($array)); // outputs bool(false) // why don't these both produce the same output?<?php
Output for 5.4.0 - 5.4.31
Parse error: syntax error, unexpected end of file in /in/cAZL6 on line 6
Process exited with code 255.
Output for 4.3.0 - 5.3.29
// PHP 5.0 or later: $array = []; var_dump(empty($array)); // outputs bool(true) $array = new ArrayObject(); var_dump(empty($array)); // outputs bool(false) // why don't these both produce the same output?<?php