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 < 10000; $i++) { 0 === strncmp($shortString, $needle, strlen($needle)); } for ($i = 0; $i < 10000; $i++) { 0 === strncmp($longString, $needle, strlen($needle)); }
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.26, 7.3.0 - 7.3.13, 7.4.0 - 7.4.1
Output for 5.6.0 - 5.6.40
Fatal error: Call to undefined function random_bytes() in /in/CXHjL on line 3
Process exited with code 255.

preferences:
134.09 ms | 401 KiB | 157 Q