3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [null, 0, '0', '']; foreach ($tests as $test) { var_dump($test); echo " -> " . strlen($test) . "\n"; }
Output for 8.1.0 - 8.1.13
NULL Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/NLAHc on line 6 -> 0 int(0) -> 1 string(1) "0" -> 1 string(0) "" -> 0
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.26
NULL -> 0 int(0) -> 1 string(1) "0" -> 1 string(0) "" -> 0

preferences:
33.29 ms | 411 KiB | 5 Q