3v4l.org

run code in 300+ PHP versions simultaneously
<?php function urlWhitelisted($url) { $always_allowed = array('localhost'); $whitelisted_domains = array_merge(array('somedomain.com'), $always_allowed); // partly snatched from https://gist.github.com/mjangda/1623788 $domain = parse_url($url, PHP_URL_HOST); if (strpos($url, "/") === 0 || in_array($domain, $whitelisted_domains)) { return true; } foreach ($whitelisted_domains as $whitelisted_domain) { $whitelisted_domain = '.' . $whitelisted_domain; if (strpos($domain, $whitelisted_domain) === (strlen($domain) - strlen($whitelisted_domain))) { return true; } } return false; } $domains = array('/user', 'localhost/user', 'http://localhost:4039', 'http://somedomain.com/user', 'http://google.com', 'google.com', 'somedomain.com.google.com'); foreach($domains as $domain) { var_dump(urlWhitelisted($domain)); }

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.0090.00618.56
8.3.50.0120.00522.00
8.3.40.0150.00018.70
8.3.30.0110.00419.08
8.3.20.0050.00220.34
8.3.10.0070.00023.70
8.3.00.0050.00320.80
8.2.180.0070.00716.63
8.2.170.0070.01122.96
8.2.160.0200.00020.39
8.2.150.0000.00724.18
8.2.140.0090.00024.66
8.2.130.0130.00726.16
8.2.120.0080.00019.48
8.2.110.0030.00619.04
8.2.100.0040.00717.91
8.2.90.0040.00419.05
8.2.80.0040.00417.97
8.2.70.0030.00517.63
8.2.60.0060.00317.93
8.2.50.0000.00918.07
8.2.40.0000.00818.16
8.2.30.0070.00018.16
8.2.20.0040.00417.77
8.2.10.0000.00718.16
8.2.00.0000.01117.89
8.1.280.0140.01125.92
8.1.270.0070.00023.70
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0070.00322.61
8.1.230.0060.00618.81
8.1.220.0030.00517.78
8.1.210.0000.00818.77
8.1.200.0100.00017.23
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0050.00518.61
8.1.160.0040.00422.03
8.1.150.0000.00818.59
8.1.140.0050.00317.46
8.1.130.0030.00319.53
8.1.120.0050.00217.48
8.1.110.0000.00817.46
8.1.100.0040.00417.45
8.1.90.0030.00517.48
8.1.80.0000.00817.37
8.1.70.0030.00317.40
8.1.60.0060.00317.61
8.1.50.0000.00917.50
8.1.40.0040.00417.50
8.1.30.0000.00817.61
8.1.20.0050.00317.68
8.1.10.0000.00717.39
8.1.00.0030.00617.51
8.0.300.0030.00618.77
8.0.290.0040.00416.75
8.0.280.0030.00318.45
8.0.270.0030.00317.27
8.0.260.0000.00717.17
8.0.250.0070.00016.96
8.0.240.0000.00716.95
8.0.230.0040.00417.01
8.0.220.0000.00716.87
8.0.210.0030.00316.88
8.0.200.0050.00516.98
8.0.190.0000.00816.94
8.0.180.0040.00416.95
8.0.170.0000.00816.89
8.0.160.0030.00317.04
8.0.150.0030.00616.79
8.0.140.0070.00016.89
8.0.130.0000.00613.31
8.0.120.0040.00416.84
8.0.110.0000.00716.93
8.0.100.0000.00816.82
8.0.90.0000.00716.76
8.0.80.0030.01216.91
8.0.70.0000.00716.74
8.0.60.0000.00716.91
8.0.50.0000.00817.03
8.0.30.0110.00817.14
8.0.20.0080.01117.40
8.0.10.0040.00416.97
8.0.00.0100.00816.77
7.4.330.0050.00015.00
7.4.320.0030.00316.54
7.4.300.0000.00716.61
7.4.290.0000.00816.64
7.4.280.0040.00416.41
7.4.270.0030.00316.52
7.4.260.0040.00416.58
7.4.250.0040.00416.46
7.4.240.0020.00616.51
7.4.230.0050.00316.70
7.4.220.0130.01316.66
7.4.210.0060.00916.66
7.4.200.0030.00316.60
7.4.160.0100.01016.29
7.4.150.0170.00717.40
7.4.140.0100.00717.86
7.4.130.0100.00716.52
7.4.120.0060.01016.49
7.4.110.0080.00816.51
7.4.100.0100.00716.40
7.4.90.0030.01516.43
7.4.80.0070.01619.39
7.4.70.0070.01416.38
7.4.60.0100.00716.64
7.4.50.0040.00416.67
7.4.40.0070.01016.36
7.4.30.0100.00716.67
7.4.00.0060.00315.03
7.3.330.0030.00313.39
7.3.320.0000.00613.38
7.3.310.0080.00016.29
7.3.300.0030.00316.27
7.3.290.0100.00316.33
7.3.280.0110.00416.36
7.3.270.0180.00017.40
7.3.260.0090.00916.60
7.3.250.0140.00616.30
7.3.240.0150.00716.38
7.3.230.0120.00616.68
7.3.210.0130.00716.40
7.3.200.0100.00719.39
7.3.190.0120.01216.42
7.3.180.0030.01216.72
7.3.170.0100.01016.39
7.3.160.0030.01316.44
7.3.120.0000.01314.93
7.3.110.0000.01714.99
7.3.100.0090.00314.78
7.3.90.0000.01514.61
7.3.80.0070.00714.69
7.3.70.0040.00814.90
7.3.60.0100.00314.89
7.3.50.0000.01714.95
7.3.40.0120.00314.98
7.3.30.0040.01214.73
7.3.20.0070.00716.85
7.3.10.0070.00516.59
7.3.00.0050.00916.51
7.2.330.0130.00416.69
7.2.320.0100.00716.64
7.2.310.0090.00916.70
7.2.300.0080.00916.51
7.2.290.0060.00916.50
7.2.240.0030.01015.22
7.2.230.0120.00314.97
7.2.220.0040.01114.88
7.2.210.0000.01515.21
7.2.200.0030.01015.02
7.2.190.0060.00914.84
7.2.180.0090.00314.89
7.2.170.0040.00715.08
7.2.160.0000.01115.04
7.2.150.0120.00416.75
7.2.140.0030.01016.91
7.2.130.0050.00816.94
7.2.120.0030.01216.91
7.2.110.0060.00816.93
7.2.100.0060.00816.86
7.2.90.0010.01117.06
7.2.80.0020.01116.93
7.2.70.0070.00916.98
7.2.60.0050.00817.03
7.2.50.0020.01116.89
7.2.40.0070.00616.92
7.2.30.0080.00716.97
7.2.20.0030.01116.98
7.2.10.0060.01116.93
7.2.00.0050.00917.51
7.1.330.0030.01315.64
7.1.320.0000.01415.69
7.1.310.0060.00615.93
7.1.300.0080.00415.59
7.1.290.0030.01015.82
7.1.280.0030.00715.67
7.1.270.0040.01115.88
7.1.260.0080.00416.02
7.1.250.0060.00515.77
7.1.240.0070.00415.92
7.1.230.0120.00315.86
7.1.220.0090.00015.63
7.1.210.0100.00015.74
7.1.200.0000.01015.82
7.1.190.0110.00315.81
7.1.180.0030.00915.71
7.1.170.0030.00715.62
7.1.160.0000.01115.87
7.1.150.0030.00615.88
7.1.140.0050.00215.59
7.1.130.0060.00615.68
7.1.120.0030.00715.90
7.1.110.0140.00015.92
7.1.100.0080.00616.89
7.1.90.0140.00015.68
7.1.80.0090.00315.59
7.1.70.0080.00316.46
7.1.60.0070.01017.83
7.1.50.0060.01316.24
7.1.40.0000.01215.55
7.1.30.0030.01015.73
7.1.20.0090.00015.48
7.1.10.0060.00615.38
7.1.00.0060.04019.11
7.0.330.0090.00015.33
7.0.320.0030.01015.45
7.0.310.0000.01015.10
7.0.300.0000.00915.13
7.0.290.0060.00715.08
7.0.280.0060.00615.39
7.0.270.0030.00714.92
7.0.260.0040.00415.44
7.0.250.0040.00815.28
7.0.240.0070.00715.44
7.0.230.0030.01115.58
7.0.220.0000.00815.36
7.0.210.0090.00015.39
7.0.200.0030.00716.26
7.0.190.0030.00915.31
7.0.180.0040.00815.32
7.0.170.0040.00815.40
7.0.160.0030.01015.15
7.0.150.0030.00715.48
7.0.140.0070.03618.80
7.0.130.0030.00615.48
7.0.120.0030.00615.17
7.0.110.0080.00015.11
7.0.100.0040.00815.51
7.0.90.0090.00315.43
7.0.80.0040.00715.25
7.0.70.0040.02818.66
7.0.60.0110.04018.43
7.0.50.0080.03818.84
7.0.40.0030.03116.74
7.0.30.0070.04016.78
7.0.20.0040.04116.70
7.0.10.0050.03016.76
7.0.00.0040.02816.69
5.6.380.0040.00414.66
5.6.370.0030.00714.40
5.6.360.0070.00414.05
5.6.350.0000.01114.51
5.6.340.0030.00614.45
5.6.330.0030.00614.37
5.6.320.0040.00914.08
5.6.310.0100.00314.40
5.6.300.0110.00414.41
5.6.290.0080.00414.04
5.6.280.0070.04017.78
5.6.270.0030.00614.44
5.6.260.0030.00614.64
5.6.250.0060.00314.48
5.6.240.0030.00914.34
5.6.230.0060.00614.32
5.6.220.0090.04217.46
5.6.210.0000.05017.49
5.6.200.0030.04217.68
5.6.190.0060.04617.71
5.6.180.0090.04017.80
5.6.170.0050.03517.68
5.6.160.0010.04817.69
5.6.150.0040.04217.46
5.6.140.0100.03217.75
5.6.130.0050.04517.72
5.6.120.0040.03817.69
5.6.110.0060.04217.81
5.6.100.0090.04017.60
5.6.90.0080.04317.64
5.6.80.0050.03517.31
5.6.70.0020.04717.20
5.6.60.0080.04117.30
5.6.50.0030.03117.39
5.6.40.0070.04017.33
5.6.30.0040.04417.36
5.6.20.0030.04017.25
5.6.10.0030.03317.21
5.6.00.0080.03817.20
5.5.380.0040.00411.19
5.5.370.0040.00411.38
5.5.360.0090.04215.86
5.5.350.0060.04315.69
5.5.340.0050.04315.94
5.5.330.0070.04515.96
5.5.320.0070.03415.92
5.5.310.0080.04115.87
5.5.300.0060.04315.87
5.5.290.0040.04816.06
5.5.280.0080.04015.96
5.5.270.0020.03515.91
5.5.260.0050.04115.95
5.5.250.0110.04015.92
5.5.240.0070.04115.67
5.5.230.0020.03015.67
5.5.220.0070.04015.74
5.5.210.0030.03015.72
5.5.200.0070.03815.64
5.5.190.0050.03715.63
5.5.180.0050.03815.63
5.5.170.0000.00710.98
5.5.160.0030.04215.50
5.5.150.0030.04215.79
5.5.140.0030.02915.63
5.5.130.0050.02915.63
5.5.120.0040.04315.56
5.5.110.0020.03415.68
5.5.100.0030.03715.45
5.5.90.0020.03315.53
5.5.80.0030.04315.62
5.5.70.0020.04415.47
5.5.60.0070.02815.48
5.5.50.0020.04315.63
5.5.40.0050.03615.60
5.5.30.0080.04015.58
5.5.20.0050.03715.40
5.5.10.0030.03115.46
5.5.00.0070.03815.47
5.4.450.0020.04915.35
5.4.440.0080.04015.17
5.4.430.0060.02315.15
5.4.420.0030.03315.22
5.4.410.0050.04315.23
5.4.400.0030.02715.08
5.4.390.0040.04214.95
5.4.380.0100.03215.04
5.4.370.0000.04315.04
5.4.360.0010.04015.08
5.4.350.0080.03714.94
5.4.340.0020.04615.07
5.4.330.0040.00410.90
5.4.320.0030.03515.14
5.4.310.0020.03915.06
5.4.300.0070.04215.11
5.4.290.0020.04115.14
5.4.280.0070.04214.97
5.4.270.0060.03815.05
5.4.260.0050.04114.97
5.4.250.0070.02514.91
5.4.240.0030.04015.01
5.4.230.0050.04214.88
5.4.220.0050.04214.88
5.4.210.0050.03815.03
5.4.200.0070.04314.88
5.4.190.0030.03915.01
5.4.180.0050.02514.92
5.4.170.0020.04214.97
5.4.160.0040.03714.96
5.4.150.0050.04215.04
5.4.140.0080.04013.55
5.4.130.0020.04013.68
5.4.120.0070.03713.65
5.4.110.0040.04313.68
5.4.100.0030.03013.64
5.4.90.0070.03513.68
5.4.80.0030.04113.76
5.4.70.0080.03013.62
5.4.60.0030.02813.71
5.4.50.0020.03213.63
5.4.40.0060.03713.70
5.4.30.0020.03013.66
5.4.20.0070.03513.83
5.4.10.0000.04813.74
5.4.00.0030.02813.34
5.3.290.0020.03012.81
5.3.280.0100.03812.71
5.3.270.0050.02912.77
5.3.260.0050.04012.78
5.3.250.0070.03712.82
5.3.240.0020.03812.81
5.3.230.0070.04012.79
5.3.220.0050.03812.73
5.3.210.0030.03812.71
5.3.200.0050.03812.71
5.3.190.0040.02412.78
5.3.180.0050.03812.73
5.3.170.0000.04112.79
5.3.160.0020.03312.79
5.3.150.0030.03812.76
5.3.140.0050.02812.74
5.3.130.0030.02212.74
5.3.120.0050.04012.77
5.3.110.0050.04012.73
5.3.100.0050.02012.48
5.3.90.0020.02212.49
5.3.80.0030.02212.46
5.3.70.0020.04012.42
5.3.60.0030.03912.44
5.3.50.0070.03512.42
5.3.40.0040.03912.45
5.3.30.0050.03712.41
5.3.20.0020.03512.24
5.3.10.0050.03512.28
5.3.00.0020.03812.29
5.2.170.0030.02711.95
5.2.160.0030.03311.95
5.2.150.0020.03411.95
5.2.140.0020.02711.95
5.2.130.0040.02811.95
5.2.120.0020.02811.95
5.2.110.0040.03011.95
5.2.100.0000.02811.95
5.2.90.0050.02711.95
5.2.80.0060.03011.95
5.2.70.0000.02811.95
5.2.60.0010.03111.95
5.2.50.0020.03611.95
5.2.40.0030.03111.95
5.2.30.0000.03611.95
5.2.20.0030.03311.95
5.2.10.0060.02811.95
5.2.00.0070.03111.95
5.1.60.0020.02711.95
5.1.50.0050.02711.95
5.1.40.0020.02211.95
5.1.30.0050.02811.95
5.1.20.0040.03011.95
5.1.10.0040.02911.95
5.1.00.0060.02511.95
5.0.50.0020.02411.95
5.0.40.0020.01511.95
5.0.30.0020.03411.95
5.0.20.0020.02411.95
5.0.10.0060.01511.95
5.0.00.0020.01911.95
4.4.90.0010.02111.95
4.4.80.0000.02011.95
4.4.70.0020.01611.95
4.4.60.0000.02011.95
4.4.50.0020.01911.95
4.4.40.0000.03511.95
4.4.30.0000.01511.95
4.4.20.0070.01511.95
4.4.10.0000.02011.95
4.4.00.0000.02711.95
4.3.110.0010.01911.95
4.3.100.0020.01211.95
4.3.90.0020.02111.95
4.3.80.0030.02811.95
4.3.70.0020.02011.95
4.3.60.0000.02111.95
4.3.50.0030.01711.95
4.3.40.0000.03011.95
4.3.30.0000.01611.95
4.3.20.0020.01211.95
4.3.10.0000.02011.95
4.3.00.0020.02011.95

preferences:
49.32 ms | 401 KiB | 5 Q