3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = trim('false'); echo $str . "\n"; 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"; }

preferences:
48.59 ms | 402 KiB | 5 Q