3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $bool = false; echo 'is ', var_export($bool, true), 'empty? ', var_export(empty($bool)), "\n"; $str = (string)$bool; echo 'is ', var_export($str, true), 'empty? ', var_export(empty($str)), "\n"; $bool = (bool)$string; echo 'is ', var_export($bool, true), 'empty? ', var_export(empty($bool)), "\n";
Output for 5.0.4 - 5.6.28, 7.0.0 - 7.1.0
is falseempty? true is ''empty? true Notice: Undefined variable: string in /in/KVO3s on line 8 is falseempty? true
Output for hhvm-3.10.0 - 3.12.0
is falseempty? true1 is ''empty? true1 Notice: Undefined variable: string in /in/KVO3s on line 8 is falseempty? true1
Output for 4.3.0 - 5.0.3
is falseempty? true is ''empty? true Notice: Undefined variable: string in /in/KVO3s on line 8 is falseempty? true