3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ null, [], ['foo'] ]; foreach ($tests as $test) { echo "\n--------------\n" . var_export($test, true) . " has a boolean value of: " . var_export((bool)$test, true) . " - "; if ($test) { echo "pass"; } else { echo "fail"; } }

preferences:
62.41 ms | 402 KiB | 5 Q