3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); if (!isset($_SESSION)) { header("Location:input.php"); } else { $greeting = "Welcome " .$_SESSION["username"]. ", let's string your strings " .$_SESSION["s1"]. " and " .$_SESSION["s2"]. "!"; if (!isset($_GET["conxy"])) { $conxvar = ""; // function to conx+y with GET and append parameter to URL } else { $conxvar = "The strings x+y have been concatenated: ". $_SESSION["s1"].$_SESSION["s2"]; echo $conxvar; } if (!isset($_GET["conyx"])) { $conyvar = ""; // function to conx+y with GET and append parameter to URL } else { $conyvar = "The strings y+x have been concatenated: ". $_SESSION["s2"].$_SESSION["s1"]; echo $conyvar; } if (!isset($_GET["conyx"])) { $subvar = ""; // function to check substring with GET and append parameter to URL } else { $compareX = strpos($_SESSION["s2"], $_SESSION["s1"]); $compareY = strpos($_SESSION["s1"], $_SESSION["s2"]); if ($compareX !== false) { $subvar = "String ".$_SESSION["s1"]. " is a substring of " .$_SESSION["s2"]; } else { $subvar = "String ".$_SESSION["s1"]. " is NOT a substring of " .$_SESSION["s2"]; } if ($compareY !== false) { $subvar += " and string ".$_SESSION['s2']. " is a substring of " .$_SESSION['s1']; } else { $subvar += " and string ".$_SESSION['s2']. " is NOT a substring of " .$_SESSION['s1']; } echo $subvar; } //} ?> <!DOCTYPE html> <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="jquery-1.11.0.js"></script> <script type="text/javascript"></script></head> <body> <div id="greeting" value=<?php echo $greeting ?> </div> <br/><br/> <input type="button" name="op" id="conxy" value="CON x+y"/> <div id="conx-y" value= <?php echo $conxvar ?> </div><br/><br/> <input type="button" name="op" id="conyx" value="CON y+x"/> <div id="cony-x" value= <?php echo $conyvar ?> </div><br/><br/> <input type="button" name="op" id="subxy" value="SUB XorY"/> <div id="subxoy" value= <?php echo $subvar ?> </div><br/><br/> <script> (function() { $('#conx-y').hide(); $('#cony-x').hide(); $('#subxoy').hide(); $('#conxy').click(function() { //e.preventDefault(); $.ajax({ url: 'strings.php', type: 'GET', dataType: 'json', data: $(this).serialize(), success: function(data) { $('#conx-y').html(data); $('#conx-y').show(); } }); }); $('#conyx').click(function() { //e.preventDefault(); $.ajax({ url: 'strings.php', type: 'GET', dataType: 'json', data: $(this).serialize(), success: function(data) { $('#cony-x').html(data); $('#cony-x').show(); } }); }); })(); </script> </body> </html>

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)
5.4.280.0000.05019.16
5.4.270.0100.06019.19
5.4.260.0000.04718.79
5.4.250.0000.08319.15
5.4.240.0030.05018.91
5.4.230.0070.07319.14
5.4.220.0070.04018.80
5.4.210.0130.06718.80
5.4.200.0070.07319.19
5.4.190.0130.07318.79
5.4.180.0030.04318.96
5.4.170.0070.07319.07
5.4.160.0070.05719.06
5.4.150.0070.03719.11
5.4.140.0030.04716.39
5.4.130.0000.05016.24
5.4.120.0100.06316.37
5.4.110.0070.06716.31
5.4.100.0030.04716.49
5.4.90.0070.03316.16
5.4.80.0070.03316.22
5.4.70.0030.04016.31
5.4.60.0100.06016.23
5.4.50.0070.06716.38
5.4.40.0070.07016.21
5.4.30.0070.04316.38
5.4.20.0130.03316.27
5.4.10.0030.05316.27
5.4.00.0130.02715.71
5.3.280.0030.04314.54
5.3.270.0070.05014.57
5.3.260.0030.05014.55
5.3.250.0100.03314.41
5.3.240.0030.07714.57
5.3.230.0030.06314.55
5.3.220.0030.04714.41
5.3.210.0070.03314.54
5.3.200.0000.04314.52
5.3.190.0030.04014.52
5.3.180.0130.04314.52
5.3.170.0100.03014.49
5.3.160.0070.06314.67
5.3.150.0100.07314.67
5.3.140.0070.04714.39
5.3.130.0030.07014.54
5.3.120.0070.05714.49
5.3.110.0000.04014.45
5.3.100.0000.04713.98
5.3.90.0070.07713.97
5.3.80.0100.06014.00
5.3.70.0130.07013.99
5.3.60.0100.04313.98
5.3.50.0070.03313.89
5.3.40.0070.06713.99
5.3.30.0130.06013.85
5.3.20.0030.04313.80
5.3.10.0070.03313.64
5.3.00.0000.08013.74

preferences:
141.27 ms | 1386 KiB | 7 Q