3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (isset ($_POST['submit'])) { $url = $_POST['url']; /* People tends to do funny things with curl. */ if (preg_match ('/[https?|[st]?ftp|dict|gopher|scp|telnet|ldaps?]\:\/\/.*(\d+|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/i', $url)) { die('Please do not access by IP.'); } elseif (preg_match ('/localhost/i', $url)) { die ('Please do not access localhost.'); } if (stripos ($url, '/', -1) !== '/') { $url .= '/'; } $url .= 'index.php'; try { $ch = curl_init ($url); if (FALSE === $ch) { throw new Exception('failed to initialize'); } elseif (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')){ curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); } curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $result = curl_exec($ch); curl_close($ch); } catch (Exception $e) { trigger_error (sprintf ('Curl failed with #%d: %s', $e->getCode(), $e->getMessage()), E_USER_ERROR); } } ?> <!DOCTYPE html> <html> <head> <title>#WebSec Level Six</title> <link rel="stylesheet" href="../static/bootstrap.min.css" /> <!-- 23:10:41 <Mantis> I have locked down flag.php - It can only be accessed locally. --> </head> <body> <div id="main"> <div class="container"> <div class="row"> <h1>Level Six <small>- URL Grabber</small></h1> </div> <div class="row"> <p class="lead"> So we created a URL grabber which fetches remote URLs.<br /> Of course you can view the source code <a href="source.php">here</a> </p> </div> </div> <div class="container"> <div class="row"> <label for="url">Enter the URL you wish to fetch:</label> <form class="form-inline" action="" method="post"> <div class="form-group"> <div class="input-group"> <div class="input-group-addon"><span class="glyphicon glyphicon-save" aria-hidden="true"></span></div> <input type="text" name="url" id="url" placeholder="http://example.com/file_to_get" class="form-control" required/> </div> <input type="submit" name="submit" value="Submit" class="form-control btn btn-default" /> </div> </form> </div> </div> <?php if (isset($result) and !!$result): ?> <hr> <div class="container"> <div class="row"> <div class="well"> <?php echo $result; ?> </div> </div> </div> <?php endif ?> </div> </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)
8.3.40.0100.00518.84
8.3.30.0070.00718.84
8.3.20.0000.00720.38
8.3.10.0040.00421.85
8.3.00.0040.00417.63
8.2.170.0090.00622.96
8.2.160.0030.01020.36
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0050.00321.05
8.2.120.0000.00726.35
8.2.110.0100.00022.29
8.2.100.0040.00717.72
8.2.90.0040.00417.84
8.2.80.0030.00617.75
8.2.70.0000.00817.50
8.2.60.0000.00817.93
8.2.50.0090.00018.07
8.2.40.0040.00418.16
8.2.30.0050.00218.11
8.2.20.0000.00717.98
8.2.10.0000.00718.01
8.2.00.0000.00918.16
8.1.270.0070.00022.07
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0070.00322.47
8.1.230.0070.00420.92
8.1.220.0000.00817.78
8.1.210.0040.00418.95
8.1.200.0100.00017.23
8.1.190.0050.00317.35
8.1.180.0050.00318.10
8.1.170.0070.00418.52
8.1.160.0050.00318.86
8.1.150.0030.00520.71
8.1.140.0060.00319.47
8.1.130.0030.00318.91
8.1.120.0030.00617.34
8.1.110.0000.00717.34
8.1.100.0040.00417.34
8.1.90.0040.00717.50
8.1.80.0050.00317.39
8.1.70.0000.00717.43
8.1.60.0000.00817.45
8.1.50.0030.00617.40
8.1.40.0040.00417.50
8.1.30.0040.00417.57
8.1.20.0040.00417.68
8.1.10.0000.00817.50
8.1.00.0000.00817.53
8.0.300.0070.00020.15
8.0.290.0060.00316.75
8.0.280.0040.00418.49
8.0.270.0030.00317.29
8.0.260.0030.00316.82
8.0.250.0030.00316.95
8.0.240.0000.00716.85
8.0.230.0100.00016.97
8.0.220.0030.00316.79
8.0.210.0000.00716.80
8.0.200.0040.00416.80
8.0.190.0030.00516.92
8.0.180.0030.00516.84
8.0.170.0030.00316.91
8.0.160.0050.00316.88
8.0.150.0000.00716.71
8.0.140.0040.00416.78
8.0.130.0000.00513.29
8.0.120.0080.00016.88
8.0.110.0070.00016.91
8.0.100.0040.00416.90
8.0.90.0000.00716.82
8.0.80.0030.01316.85
8.0.70.0080.00016.80
8.0.60.0000.00816.83
8.0.50.0040.00416.99
8.0.30.0130.00517.12
8.0.20.0110.00917.40
8.0.10.0050.00316.94
8.0.00.0070.01016.81
7.4.330.0020.00215.55
7.4.320.0000.00716.53
7.4.300.0000.00716.59
7.4.290.0050.00516.56
7.4.280.0030.00616.38
7.4.270.0000.00716.64
7.4.260.0050.00013.20
7.4.250.0000.00816.47
7.4.240.0000.00716.48
7.4.230.0030.00316.37
7.4.220.0140.00416.55
7.4.210.0090.00616.66
7.4.200.0050.00216.60
7.4.160.0150.00416.39
7.4.150.0170.01117.40
7.4.140.0110.00917.86
7.4.130.0060.01216.43
7.4.120.0100.01016.55
7.4.110.0160.00316.67
7.4.100.0000.01616.56
7.4.90.0130.00616.64
7.4.80.0070.01019.39
7.4.70.0090.00616.39
7.4.60.0000.01616.48
7.4.50.0090.00616.55
7.4.40.0070.01016.47
7.4.30.0070.01616.63
7.4.20.0070.01216.29
7.4.10.0100.00716.37
7.4.00.0040.01315.77
7.3.330.0050.00012.97
7.3.320.0030.00313.23
7.3.310.0000.00716.11
7.3.300.0060.00316.09
7.3.290.0040.00416.27
7.3.280.0090.00916.26
7.3.270.0060.00917.40
7.3.260.0170.00316.29
7.3.250.0080.00916.43
7.3.240.0070.01016.36
7.3.230.0060.01016.30
7.3.210.0070.01016.19
7.3.200.0060.01016.46
7.3.190.0110.00416.14
7.3.180.0080.00816.31
7.3.170.0120.00316.58
7.3.160.0120.00816.09
7.3.150.0170.00716.24
7.3.140.0090.00616.31
7.3.130.0100.00716.20
7.3.120.0080.01216.18
7.3.110.0090.00916.16
7.3.100.0110.00716.18
7.3.90.0000.01716.44
7.3.80.0200.00016.23
7.3.70.0130.00616.25
7.3.60.0090.01016.29
7.3.50.0140.00416.25
7.3.40.0050.01416.24
7.3.30.0070.01116.29
7.3.20.0060.01116.13
7.3.10.0100.00516.34
7.3.00.0080.00716.49
7.2.330.0140.00416.76
7.2.320.0070.01016.72
7.2.310.0070.01016.41
7.2.300.0100.00716.52
7.2.290.0120.00916.61
7.2.280.0040.01616.32
7.2.270.0060.01116.55
7.2.260.0070.01016.57
7.2.250.0120.00616.51
7.2.240.0140.00416.43
7.2.230.0080.01216.34
7.2.220.0140.00316.43
7.2.210.0090.00916.43
7.2.200.0100.01016.66
7.2.190.0130.00816.59
7.2.180.0140.00316.38
7.2.170.0060.01216.46
7.2.160.0130.00816.35
7.2.150.0060.01616.65
7.2.140.0090.01016.62
7.2.130.0070.00716.74
7.2.120.0040.00916.69
7.2.110.0090.00416.60
7.2.100.0090.00316.83
7.2.90.0080.00816.73
7.2.80.0080.00716.66
7.2.70.0040.00816.68
7.2.60.0090.00616.76
7.2.50.0070.00616.74
7.2.40.0040.01116.67
7.2.30.0070.00716.81
7.2.20.0080.00716.73
7.2.10.0060.00816.52
7.2.00.0040.00917.30
7.1.330.0180.00015.31
7.1.320.0110.01115.17
7.1.310.0190.00315.43
7.1.300.0140.00715.29
7.1.290.0110.00515.21
7.1.280.0120.00815.47
7.1.270.0090.01015.32
7.1.260.0070.01115.16
7.1.250.0100.00315.38
7.1.240.0110.01115.42
7.1.230.0090.01015.38
7.1.220.0150.00715.32
7.1.210.0090.00915.36
7.1.200.0130.00315.52
7.1.190.0220.01115.27
7.1.180.0080.01015.17
7.1.170.0110.01115.45
7.1.160.0090.01615.32
7.1.150.0070.01015.27
7.1.140.0060.01015.28
7.1.130.0420.00615.29
7.1.120.0080.01215.34
7.1.110.0140.00715.44
7.1.100.0050.01016.77
7.1.90.0100.00715.59
7.1.80.0090.01315.59
7.1.70.0070.00916.13
7.1.60.0110.01125.03
7.1.50.0070.01425.01
7.1.40.0160.00724.80
7.1.30.0110.00824.84
7.1.20.0100.01024.99
7.1.10.0090.00815.81
7.1.00.0100.00615.96
7.0.330.0160.00414.81
7.0.320.0200.00715.02
7.0.310.0140.00615.17
7.0.300.0170.00314.96
7.0.290.0100.01015.04
7.0.280.0030.01315.10
7.0.270.0060.01114.92
7.0.260.0140.00715.01
7.0.250.0170.00415.27
7.0.240.0140.00315.14
7.0.230.0140.00415.00
7.0.220.0130.00915.20
7.0.210.0030.01415.04
7.0.200.0060.00915.82
7.0.190.0050.01015.82
7.0.180.0090.00515.76
7.0.170.0130.00115.64
7.0.160.0060.01415.55
7.0.150.0060.01115.60
7.0.140.0060.01015.46
7.0.130.0070.00715.60
7.0.120.0050.00815.65
7.0.110.0080.00515.63
7.0.100.0050.00915.70
7.0.90.0080.00715.69
7.0.80.0040.01015.71
7.0.70.0100.00515.62
7.0.60.0090.00715.67
7.0.50.0060.00715.63
7.0.40.0040.01115.59
7.0.30.0090.00415.67
7.0.20.0080.00615.74
7.0.10.0080.00515.72
7.0.00.0070.00615.66
5.6.400.0120.00816.15
5.6.390.0180.00415.85
5.6.380.0070.01215.72
5.6.370.0110.00915.94
5.6.360.0070.01115.96
5.6.350.0160.00415.93
5.6.340.0140.00715.64
5.6.330.0070.01415.75
5.6.320.0110.01115.88
5.6.310.0070.01115.79
5.6.300.0130.01316.17
5.6.290.0060.02015.87
5.6.280.0080.00915.89
5.6.270.0060.01316.06
5.6.260.0070.01115.97
5.6.250.0080.01115.96
5.6.240.0030.01615.87
5.6.230.0150.00315.75
5.6.220.0090.00915.97
5.6.210.0070.01115.92
5.6.200.0100.01015.90
5.6.190.0070.01015.75
5.6.180.0050.01415.85
5.6.170.0100.00715.68
5.6.160.0030.01515.82
5.6.150.0140.00915.89
5.6.140.0070.01015.80
5.6.130.0220.00315.78
5.6.120.0170.00316.05
5.6.110.0070.01415.75
5.6.100.0140.00315.79
5.6.90.0070.01115.80
5.6.80.0080.01215.72
5.6.70.0030.01715.76
5.6.60.0060.01515.81
5.6.50.0070.01115.78
5.6.40.0120.00615.91
5.6.30.0120.00915.89
5.6.20.0100.01015.87
5.6.10.0160.00315.95
5.6.00.0120.00615.75

preferences:
50.76 ms | 400 KiB | 5 Q