3v4l.org

run code in 300+ PHP versions simultaneously
<?php // http://sudobash.net/?p=736 session_start(); session_destroy(); if(!isset($_POST['user'])){?> <?}?> <?if(isset($_POST['user'])) { ?> <?php include 'conf.php'; // Don't display the warnings - we are already setup to annoy the user ini_set( "display_errors", 0); // No funny stuff! $user = htmlspecialchars($_POST['user']); $user = explode(" ", $user); $user = $user[0]; $user = preg_replace("/[^a-zA-Z0-9_]/", "", $user); $filter = "admin=" . $user; // Connect to the LDAP server. $ldapconn = ldap_connect($server, $port) or die("Could not connect to " . $server . ":" . $port . "."); // Bind with rootreader to the LDAP server to search and retrieve DN. $ldapbind = ldap_bind($ldapconn) or die("Could not bind - contact admin@adamskalicky.com"); $result = ldap_search($ldapconn,$basedn,$filter) or die ("Search error."); $entries = ldap_get_entries($ldapconn, $result); $binddn = $entries[0]["dn"]; // Bind again using the DN retrieved. If this bind is successful, // then the user has managed to authenticate. $ldapbind = ldap_bind($ldapconn, $binddn, $_POST['password']); if ($ldapbind) { echo "<center><h2>Successful authentication for <span style='color: #000;'>" . $user . "</span></center>"; ?> <table align="center" height="200px" id="content"> <tr> <td valign="middle"> <form action="restricted.php" method="post"> <input type="hidden" name='user' value="<?=$user;?>" > <input type="submit" value="Great, Let's go!" > </form> </td> </tr> </table> <? } else { echo "<center><h2>Failed authentication for <span style='color: #000;'>" . $user . "</span><br /><br /> <a href='login.php'>Try again</a></center>"; } ldap_close($ldapconn); ?> <?}?>

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)
8.3.60.0110.00318.55
8.3.50.0070.01121.99
8.3.40.0100.00618.89
8.3.30.0110.01118.67
8.3.20.0080.00018.65
8.3.10.0000.01821.14
8.3.00.0060.01319.61
8.2.180.0120.00316.63
8.2.170.0110.00422.96
8.2.160.0120.00320.42
8.2.150.0160.00324.18
8.2.140.0070.00024.66
8.2.130.0000.00826.16
8.2.120.0070.00021.00
8.2.110.0060.00321.04
8.2.100.0080.00317.66
8.2.90.0040.00419.09
8.2.80.0000.00817.97
8.2.70.0000.00817.38
8.2.60.0040.00417.91
8.2.50.0130.00718.07
8.2.40.0040.00417.97
8.2.30.0000.00719.30
8.2.20.0040.00417.46
8.2.10.0000.00717.48
8.2.00.0040.00417.48
8.1.280.0170.00325.92
8.1.270.0030.00523.99
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0100.00720.80
8.1.230.0060.00617.46
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0080.00017.10
8.1.190.0070.00017.28
8.1.180.0050.00318.10
8.1.170.0000.00818.51
8.1.160.0070.00018.80
8.1.150.0090.00018.50
8.1.140.0040.00417.26
8.1.130.0030.00317.67
8.1.120.0000.00717.33
8.1.110.0040.00417.25
8.1.100.0030.00317.30
8.1.90.0050.00217.32
8.1.80.0050.00217.29
8.1.70.0030.00317.35
8.1.60.0050.00517.43
8.1.50.0040.00417.39
8.1.40.0000.00817.37
8.1.30.0000.00817.40
8.1.20.0040.00417.48
8.1.10.0000.00717.39
8.1.00.0040.00417.29
8.0.300.0000.00718.77
8.0.290.0000.00716.63
8.0.280.0000.00718.28
8.0.270.0050.00317.24
8.0.260.0030.00316.73
8.0.250.0000.00716.89
8.0.240.0040.00416.96
8.0.230.0040.00416.87
8.0.220.0000.00616.87
8.0.210.0030.00316.89
8.0.200.0060.00016.83
8.0.190.0030.00516.99
8.0.180.0040.00416.80
8.0.170.0000.00916.91
8.0.160.0000.00716.79
8.0.150.0030.00316.92
8.0.140.0030.00316.85
8.0.130.0040.00413.21
8.0.120.0060.00316.96
8.0.110.0040.00416.83
8.0.100.0040.00416.86
8.0.90.0050.00216.82
8.0.80.0070.00716.93
8.0.70.0000.00716.95
8.0.60.0030.00516.99
8.0.50.0040.00416.87
8.0.30.0120.01016.97
8.0.20.0130.00617.40
8.0.10.0000.00816.95
8.0.00.0080.01016.46
7.4.330.0020.00216.66
7.4.320.0030.00316.44
7.4.300.0030.00316.26
7.4.290.0030.00316.46
7.4.280.0000.00716.27
7.4.270.0000.00616.41
7.4.260.0000.00513.14
7.4.250.0000.00716.40
7.4.240.0070.00016.49
7.4.230.0000.00716.55
7.4.220.0060.00916.25
7.4.210.0100.00616.47
7.4.200.0000.00816.53
7.4.190.0030.00316.36
7.4.160.0120.00316.21
7.4.150.0170.00017.40
7.4.140.0160.00517.86
7.4.130.0080.01016.39
7.4.120.0140.00316.34
7.4.110.0070.01016.53
7.4.100.0100.01416.32
7.4.90.0090.00916.61
7.4.80.0100.00619.39
7.4.70.0120.00616.42
7.4.60.0090.00616.34
7.4.50.0040.00416.49
7.4.40.0030.00822.77
7.4.30.0080.01416.33
7.4.00.0090.00614.97
7.3.330.0070.00013.15
7.3.320.0000.00613.15
7.3.310.0000.00716.04
7.3.300.0060.00016.18
7.3.290.0030.01016.14
7.3.280.0150.00416.18
7.3.270.0060.01117.40
7.3.260.0100.00918.24
7.3.250.0100.01016.34
7.3.240.0160.00616.36
7.3.230.0140.00316.39
7.3.210.0100.01016.46
7.3.200.0060.01019.39
7.3.190.0100.01316.14
7.3.180.0060.00916.09
7.3.170.0110.00616.39
7.3.160.0050.01116.24
7.3.120.0040.01414.89
7.2.330.0150.00316.49
7.2.320.0070.01016.20
7.2.310.0120.00616.41
7.2.300.0110.00616.52
7.2.290.0140.00316.52
7.1.100.0040.00717.92
7.1.70.0070.00317.11
7.1.60.0060.00617.27
7.1.50.0030.00716.82
7.1.40.0000.01116.51
7.1.30.0110.00016.40
7.1.20.0120.00916.71
7.1.10.0000.01116.45
7.1.00.0040.00716.38
7.0.200.0000.00816.71
7.0.190.0050.00316.76
7.0.180.0040.00416.18
7.0.170.0040.00416.29
7.0.160.0000.00916.20
7.0.150.0040.01116.22
7.0.140.0040.00416.20
7.0.130.0040.00416.70
7.0.120.0000.01116.54
7.0.110.0070.00316.12
7.0.100.0000.01016.34
7.0.90.0050.00216.25
7.0.80.0000.00816.32
7.0.70.0000.00816.32
7.0.60.0060.00615.84
7.0.50.0000.00716.39
7.0.40.0040.00415.49
7.0.30.0000.01015.49
7.0.20.0000.01115.49
7.0.10.0040.00415.49
7.0.00.0030.00815.49
5.6.300.0070.08520.69
5.6.290.0130.05220.66
5.6.280.0030.04121.04
5.6.270.0000.04720.98
5.6.260.0070.04620.75
5.6.250.0130.03520.77
5.6.240.0030.05320.95
5.6.230.0070.03720.78
5.6.220.0000.04220.91
5.6.210.0030.04621.01
5.6.200.0030.05321.00
5.6.190.0060.04920.86
5.6.180.0000.04320.78
5.6.170.0030.04620.99
5.6.160.0230.05021.00
5.6.150.0070.04220.72
5.6.140.0100.04720.96
5.6.130.0170.03820.93
5.6.120.0090.04320.74
5.6.110.0100.03820.95
5.6.100.0040.05120.89
5.6.90.0070.04220.78
5.6.80.0030.04920.18
5.6.70.0030.03920.38
5.6.60.0060.03920.31
5.6.50.0090.03720.39
5.6.40.0030.04420.27
5.6.30.0030.04320.04
5.6.20.0030.04420.34
5.6.10.0140.03520.08
5.6.00.0070.03920.36
5.5.380.0070.05017.59
5.5.370.0030.03917.41
5.5.360.0000.05417.43
5.5.350.0030.04417.49
5.5.340.0000.04717.98
5.5.330.0070.06618.02
5.5.320.0030.09117.97
5.5.310.0030.04218.11
5.5.300.0070.04217.94
5.5.290.0030.04517.94
5.5.280.0120.03817.94
5.5.270.0030.04718.04
5.5.260.0100.04517.97
5.5.250.0060.03917.67
5.5.240.0060.03417.33
5.5.230.0070.03617.21
5.5.220.0000.04117.21
5.5.210.0030.04117.49
5.5.200.0000.04117.33
5.5.190.0000.04217.29
5.5.180.0060.03917.21
5.5.160.0060.03717.36
5.5.150.0000.05517.31
5.5.140.0070.03717.38
5.5.130.0060.04317.09
5.5.120.0030.04317.42
5.5.110.0090.03317.20
5.5.100.0100.03717.31
5.5.90.0030.03817.30
5.5.80.0000.04017.27
5.5.70.0000.04817.21
5.5.60.0000.04317.36
5.5.50.0070.04316.98
5.5.40.0070.06817.21
5.5.30.0040.04916.98
5.5.20.0070.03417.27
5.5.10.0030.04317.20
5.5.00.0030.03817.20
5.4.450.0000.04919.25
5.4.440.0090.06319.23
5.4.430.0000.04719.20
5.4.420.0030.04919.36
5.4.410.0000.04919.08
5.4.400.0230.03619.04
5.4.390.0030.03918.82
5.4.380.0030.04119.11
5.4.370.0060.03419.16
5.4.360.0070.04018.98
5.4.350.0030.05218.88
5.4.340.0000.04718.86
5.4.320.0000.04618.91
5.4.310.0060.04518.91
5.4.300.0060.03918.93
5.4.290.0000.04419.01
5.4.280.0030.04119.04
5.4.270.0000.05918.99
5.4.260.0070.03419.02
5.4.250.0060.04119.06
5.4.240.0030.03918.91
5.4.230.0000.04219.16
5.4.220.0060.03919.02
5.4.210.0090.04319.16
5.4.200.0130.03819.09
5.4.190.0060.03718.90
5.4.180.0060.03818.81
5.4.170.0070.04419.05
5.4.160.0040.04318.99
5.4.150.0030.07618.86
5.4.140.0120.02916.45
5.4.130.0070.04216.38
5.4.120.0060.03516.41
5.4.110.0000.04016.66
5.4.100.0100.07216.57
5.4.90.0040.03916.34
5.4.80.0000.05116.57
5.4.70.0030.03916.55
5.4.60.0070.03116.62
5.4.50.0000.04216.62
5.4.40.0030.03816.61
5.4.30.0040.03316.46
5.4.20.0090.04416.63
5.4.10.0230.03916.47
5.4.00.0100.05516.06
5.3.290.0030.03715.49
5.3.280.0000.04015.49
5.3.270.0030.06915.49
5.3.260.0030.03715.49
5.3.250.0000.04015.49
5.3.240.0030.07815.49
5.3.230.0030.04115.49
5.3.220.0070.08815.49
5.3.210.0000.05515.49
5.3.200.0060.05215.49
5.3.190.0030.03915.49
5.3.180.0030.03815.49
5.3.170.0060.04015.49
5.3.160.0100.03815.49
5.3.150.0120.03015.49
5.3.140.0030.04515.49
5.3.130.0060.03415.49
5.3.120.0100.03215.49
5.3.110.0060.03615.49
5.3.100.0060.04215.49
5.3.90.0190.04215.49
5.3.80.0030.07215.49
5.3.70.0000.04515.49
5.3.60.0100.02915.49
5.3.50.0040.04215.49
5.3.40.0040.06015.49
5.3.30.0030.03715.49
5.3.20.0000.03815.49
5.3.10.0100.05115.49
5.3.00.0110.05315.49
5.2.170.0060.02815.49
5.2.160.0030.04515.49
5.2.150.0100.04515.49
5.2.140.0070.03715.49
5.2.130.0070.03015.49
5.2.120.0000.03315.49
5.2.110.0000.05015.49
5.2.100.0040.04215.49
5.2.90.0030.02615.49
5.2.80.0000.03615.49
5.2.70.0040.03315.49
5.2.60.0040.02915.49
5.2.50.0040.03315.49
5.2.40.0000.03215.49
5.2.30.0000.03315.49
5.2.20.0100.02415.49
5.2.10.0070.04715.49
5.2.00.0030.03815.49
5.1.60.0070.02115.49
5.1.50.0040.02615.49
5.1.40.0030.03115.49
5.1.30.0000.03215.49
5.1.20.0000.03415.49
5.1.10.0030.02715.49
5.1.00.0040.02615.49
5.0.50.0030.02115.49
5.0.40.0040.04515.49
5.0.30.0030.04015.49
5.0.20.0030.01915.49
5.0.10.0060.02615.49
5.0.00.0040.03215.49
4.4.90.0000.01715.49
4.4.80.0000.01815.49
4.4.70.0030.01415.49
4.4.60.0050.01315.49
4.4.50.0030.01715.49
4.4.40.0000.02615.49
4.4.30.0040.01415.49
4.4.20.0030.02115.49
4.4.10.0030.01315.49
4.4.00.0070.04015.49
4.3.110.0040.01815.49
4.3.100.0000.01615.49
4.3.90.0000.01815.49
4.3.80.0040.02215.49
4.3.70.0000.02315.49
4.3.60.0030.01715.49
4.3.50.0030.01715.49
4.3.40.0000.02615.49
4.3.30.0030.02115.49
4.3.20.0060.01815.49
4.3.10.0030.03515.49
4.3.00.0000.03315.49

preferences:
37.87 ms | 401 KiB | 5 Q