3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php// 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
based on cAZL6
Output for 5.4.0 - 5.5.15
Parse error: syntax error, unexpected '$array' (T_VARIABLE) in /in/qJhV0 on line 2
Process exited with code 255.
Output for 4.3.0 - 5.3.29
<?php// 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