3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $obj = new stdClass(); // False for > PHP 5 var_dump(empty($obj)); $list = array($obj, NULL, '', array()); foreach ($list as $item) { var_dump(empty($item)); var_dump(is_object($item)); }
based on FR7S2
Output for 5.0.0 - 7.2.0
bool(false) bool(false) bool(true) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false)
Output for 4.3.0 - 4.4.9
bool(true) bool(true) bool(true) bool(true) bool(false) bool(true) bool(false) bool(true) bool(false)