3v4l.org

run code in 300+ PHP versions simultaneously
<?php $textos[] = 'yuqkdp69yHryACb778mvZsbFegIBU#'; $textos[] = 'yuqk#p69yHryACb778mvZsbFigIBUh'; $textos[] = 'yuqksp69yHryACb778m#Zs#Fi#IBUh'; $textos[] = 'yuqksp69yHryACb778mvZsbFigIBUh'; $textos[] = 'yuqksp69yHryACb778mvZsb%igIBUh'; $textos[] = 'yuqksp69yHryACb778mvZsbFigIBU&'; $textos[] = 'yuqksp@9yHryACb778mvZsbFigIBUh'; foreach ($textos as $index => $texto) { for ($i = 0; $i < 10000; $i++) { $inicio = microtime(true); tem_simbolo_na_senha($texto); $fim[$index][] = microtime(true) - $inicio; } echo (int)tem_simbolo_na_senha($texto) . ' - '. $texto . ' demorou ' . array_sum($fim[$index]) / count($fim[$index]); echo PHP_EOL; } function tem_simbolo_na_senha($texto) { $return = 0; $tamanho = mb_strlen($texto, '8bit'); for($i = 0; $i < $tamanho; $i++){ $return |= (int)($texto[$i] === "#" xor $texto[$i] === "@" xor $texto[$i] === "%" xor $texto[$i] === "&"); } return $return !== 0; }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.1.70.0100.35621.16
7.1.60.0700.31421.19
7.1.50.1370.45735.59
7.1.40.0700.46735.21
7.1.30.0600.45035.47
7.1.20.0630.43735.34
7.1.10.0570.52717.13
7.1.00.0430.54017.11
7.0.200.0000.38920.97
7.0.190.0470.52717.31
7.0.180.0500.57016.87
7.0.170.0470.55016.88
7.0.160.0370.54016.74
7.0.150.0770.57016.90
7.0.140.0470.60716.89
7.0.130.0430.57717.14
7.0.120.0470.52017.14
7.0.110.0430.58716.85
7.0.100.0430.62016.89
7.0.90.0530.63716.89
7.0.80.0600.82016.75
7.0.70.0630.73316.88
7.0.60.0430.61716.91
7.0.50.0830.66016.86
7.0.40.0500.56017.07
7.0.30.0500.59716.95
7.0.20.0500.56017.00
7.0.10.0670.61717.11
7.0.00.0570.61016.92

preferences:
30.63 ms | 400 KiB | 5 Q