3v4l.org

run code in 300+ PHP versions simultaneously
<?php $needle = bin2hex(random_bytes(15)); $shortString = $needle . bin2hex(random_bytes(20)); $longString = bin2hex(random_bytes(500)) . $needle . bin2hex(random_bytes(500)); for ($i = 0; $i < 100000; $i++) { 0 === strncmp($shortString, $needle, strlen($needle)); } for ($i = 0; $i < 100000; $i++) { 0 === strncmp($longString, $needle, strlen($needle)); }
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1

preferences:
50.43 ms | 406 KiB | 5 Q