3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mystring = "micha<?php </textarea>l' OR 1=1"; $findme = "="; $pos = strpos($mystring, $findme); // Note our use of ===. Simply == would not work as expected // because the position of 'a' was the 0th (first) character. if (strpos($mystring, $findme) === false) { //echo "The string '$findme' was not found in the string '$mystring'"; echo 'nenasiel som :('; } else { echo 'je tam'; //echo "The string '$findme' was found in the string '$mystring'"; //echo " and exists at position $pos"; } echo "\n"; echo 'This ', 'string ', 'was ', 'made ', 'with multiple parameters.', chr(10); echo 'This ' . 'string ' . 'was ' . 'made ' . 'with concatenation.' . "\n"; $forbiddenChar = array("<", ">", "'", "=", "--"); echo $forbiddenChar[0] . ", ". $forbiddenChar[1] . ", " . $forbiddenChar[2] . ", " . $forbiddenChar[3] . ", " . $forbiddenChar[4] . "\n"; $numberFound = 0; foreach(i in $forbiddenChar) { if (strpos($mystring, $forbiddenChar[i]) === false) { } else { // nieco som nasiel ++$numberFound; } } if ($numberFound > 0 ) { echo "nieco som nasiel\n"; } ?>

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.0070.00716.90
7.1.60.0170.01335.09
7.1.50.0120.01634.81
7.1.40.0070.02134.18
7.1.30.0150.01534.31
7.1.20.0250.00634.55
7.1.10.0060.00916.26
7.1.00.0080.00416.35
7.0.200.0030.00916.48
7.0.190.0000.01216.50
7.0.180.0000.01316.15
7.0.170.0080.00515.98
7.0.160.0090.00416.00
7.0.150.0070.00715.95
7.0.140.0040.00916.11
7.0.130.0090.00316.13
7.0.120.0000.01216.31
7.0.110.0040.00816.23
7.0.100.0030.01016.24
7.0.90.0080.00416.29
7.0.80.0030.00916.27
7.0.70.0070.01016.04
7.0.60.0060.00616.09
7.0.50.0000.01316.20
7.0.40.0090.00316.29
7.0.30.0090.00616.41
7.0.20.0030.01016.48
7.0.10.0030.01016.23
7.0.00.0030.00916.07

preferences:
143.56 ms | 1394 KiB | 7 Q