3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(null); var_dump( empty( $a ) ); //bool(false) var_dump( !(bool)$a ); //bool(true) $b = array(false); var_dump( empty( $b ) ); //bool(false) var_dump( !(bool)$b ); //bool(true) $c = array(0); var_dump( empty( $c ) ); //bool(false) var_dump( !(bool)$c ); //bool(false) $d = array(''); var_dump( empty( $d ) ); //bool(false) var_dump( !(bool)$d ); //bool(false) $e = array(); var_dump( empty( $e ) ); //bool(true) var_dump( !(bool)$e ); //bool(false)
Output for 4.3.0 - 5.0.5, 5.1.1 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(true) bool(true)
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/CZiWA on line 21
Process exited with code 255.