3v4l.org

run code in 500+ PHP versions simultaneously
<?php use function PHPStan\dumpType; use function PHPStan\Testing\assertType; function doFoo(string $namespace):void { if (substr($namespace, 0, 4) === 'hello-world') {var_dump(__LINE__);} if ('hello-world' === substr($namespace, 0, 4)) {var_dump(__LINE__);} if (substr($namespace, 0, 13) === 'hello-world') {var_dump(__LINE__);} if ('hello-world' === substr($namespace, 0, 13)) {var_dump(__LINE__);} if (substr($namespace, 0, 11) === 'hello-world') {var_dump(__LINE__);} if ('hello-world' === substr($namespace, 0, 11)) {var_dump(__LINE__);} } doFoo('hello-world'); var_dump('--'); doFoo('abc'); var_dump('--'); doFoo('hello-world-in-php');

preferences:
21.56 ms | 474 KiB | 4 Q