3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = '0'; if ($str) { echo "option 1: not empty\n"; } if (strlen($str)) { echo "option 2: not empty\n"; } if (!empty($str)) { echo "option 3: not empty\n"; } if ($str !== '') { echo "option 4: not empty\n"; }
Output for 4.3.0 - 7.1.0
option 2: not empty option 4: not empty