3v4l.org

run code in 300+ PHP versions simultaneously
<?php function urlWhitelisted($url) { $always_allowed = array('localhost'); $whitelisted_domains = array('fxnetworks.com') + $always_allowed; if (strpos($url, "/") !== 0 && strpos($url, "http") !== 0) { $url = 'http://' . $url; } $domain = parse_url($url, PHP_URL_HOST); var_dump($domain); 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://fxnetworks.com/user', 'http://google.com', 'google.com', 'fxnetworks.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.0070.00718.43
8.3.50.0060.01022.06
8.3.40.0030.01718.67
8.3.30.0070.01318.95
8.3.20.0050.00320.33
8.3.10.0080.00023.63
8.3.00.0040.00420.64
8.2.180.0000.01818.41
8.2.170.0090.00622.96
8.2.160.0070.00720.39
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0130.00626.16
8.2.120.0060.00319.48
8.2.110.0090.00020.35
8.2.100.0040.00817.97
8.2.90.0040.00419.14
8.2.80.0060.00317.97
8.2.70.0040.00417.75
8.2.60.0000.00917.93
8.2.50.0080.00018.07
8.2.40.0030.00519.91
8.2.30.0070.00018.16
8.2.20.0000.00717.74
8.2.10.0000.00718.16
8.2.00.0030.00617.86
8.1.280.0110.00425.92
8.1.270.0080.00023.84
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0100.00023.65
8.1.230.0070.00420.93
8.1.220.0080.00017.78
8.1.210.0060.00318.77
8.1.200.0080.00417.35
8.1.190.0040.00817.23
8.1.180.0030.00618.10
8.1.170.0050.00318.65
8.1.160.0070.00022.01
8.1.150.0070.00018.54
8.1.140.0020.00517.44
8.1.130.0070.00017.76
8.1.120.0040.00417.48
8.1.110.0000.00717.45
8.1.100.0050.00217.52
8.1.90.0040.00417.35
8.1.80.0000.00717.46
8.1.70.0000.00717.38
8.1.60.0040.00417.58
8.1.50.0080.00017.41
8.1.40.0000.00717.53
8.1.30.0040.00417.69
8.1.20.0050.00317.55
8.1.10.0050.00317.50
8.1.00.0040.00417.52
8.0.300.0040.00418.77
8.0.290.0050.00316.88
8.0.280.0070.00018.44
8.0.270.0070.00017.19
8.0.260.0030.00317.26
8.0.250.0040.00416.98
8.0.240.0000.00816.97
8.0.230.0030.00517.08
8.0.220.0030.00316.87
8.0.210.0060.00016.92
8.0.200.0030.00317.00
8.0.190.0030.00316.96
8.0.180.0040.00416.88
8.0.170.0000.00817.00
8.0.160.0040.00416.93
8.0.150.0040.00416.96
8.0.140.0040.00416.95
8.0.130.0050.00013.33
8.0.120.0040.00416.89
8.0.110.0000.00717.00
8.0.100.0000.00716.90
8.0.90.0050.00316.75
8.0.80.0030.01316.89
8.0.70.0040.00416.92
8.0.60.0050.00316.89
8.0.50.0040.00316.99
8.0.30.0100.01017.20
8.0.20.0080.01317.44
8.0.10.0040.00416.99
8.0.00.0090.00816.74
7.4.330.0000.00515.01
7.4.320.0030.00316.50
7.4.300.0000.00616.61
7.4.290.0040.00716.61
7.4.280.0080.00016.44
7.4.270.0000.00716.58
7.4.260.0000.00716.38
7.4.250.0040.00416.61
7.4.240.0050.00216.44
7.4.230.0030.00316.50
7.4.220.0110.00716.50
7.4.210.0080.00816.50
7.4.200.0030.00316.52
7.4.160.0080.00816.61
7.4.150.0110.00717.40
7.4.140.0110.00817.86
7.4.130.0140.00416.47
7.4.120.0100.00616.46
7.4.110.0080.00916.56
7.4.100.0230.00016.64
7.4.90.0090.00616.44
7.4.80.0120.00919.39
7.4.70.0110.00616.45
7.4.60.0110.00716.58
7.4.50.0060.00316.61
7.4.40.0160.00016.63
7.4.30.0120.00316.69
7.4.00.0070.01014.79
7.3.330.0030.00313.34
7.3.320.0030.00313.38
7.3.310.0050.00216.47
7.3.300.0000.00716.17
7.3.290.0060.00916.30
7.3.280.0110.00816.36
7.3.270.0060.01017.40
7.3.260.0120.00616.45
7.3.250.0120.00816.59
7.3.240.0110.01116.66
7.3.230.0100.00716.50
7.3.210.0130.00716.58
7.3.200.0080.00819.39
7.3.190.0110.00816.55
7.3.180.0030.01316.32
7.3.170.0130.00316.38
7.3.160.0130.00316.34
7.3.120.0030.01214.75
7.2.330.0140.00716.75
7.2.320.0030.01516.84
7.2.310.0060.01216.69
7.2.300.0080.00816.65
7.2.290.0120.00616.52
7.2.00.0070.00719.50
7.1.100.0030.01018.16
7.1.70.0070.00717.18
7.1.60.0070.01019.70
7.1.50.0140.01116.92
7.1.00.0030.07722.30
7.0.200.0030.00516.82
7.0.140.0030.07022.07
7.0.60.0030.04020.01
7.0.50.0030.04717.98
7.0.40.0130.08019.96
7.0.30.0230.06720.17
7.0.20.0370.06720.25
7.0.10.0000.09320.07
7.0.00.0000.09020.08
5.6.280.0070.07020.82
5.6.210.0100.07020.55
5.6.200.0100.04718.17
5.6.190.0030.06020.50
5.6.180.0300.07720.55
5.6.170.0230.05720.45
5.6.160.0130.08020.52
5.6.150.0030.07318.18
5.6.140.0030.08718.14
5.6.130.0030.08018.21
5.6.120.0100.08021.02
5.6.110.0070.08321.09
5.6.100.0130.03321.02
5.6.90.0170.07721.00
5.6.80.0000.08320.36
5.6.70.2370.04320.38
5.5.350.0000.09020.42
5.5.340.0030.04017.95
5.5.330.0170.06720.43
5.5.320.0300.05320.27
5.5.310.0270.05320.32
5.5.300.0030.06318.02
5.5.290.0130.06318.09
5.5.280.0130.05020.80
5.5.270.0070.09020.77
5.5.260.0070.06320.87
5.5.250.0070.06320.69
5.5.240.2670.04320.20
5.4.450.0230.07019.48
5.4.440.0170.03719.41
5.4.430.0170.03719.21
5.4.420.0130.04319.31
5.4.410.0170.04319.14
5.4.400.0130.07318.92
5.4.390.0170.03319.08
5.4.380.0200.04019.31
5.4.370.0170.03319.16
5.4.360.0130.03719.13
5.4.350.0100.04019.19
5.4.340.0100.04319.24
5.4.320.0170.03719.32
5.4.310.0200.04019.13
5.4.300.0200.05718.99
5.4.290.0270.06019.11
5.4.280.0270.06719.16
5.4.270.0230.05718.95
5.4.260.0270.05319.15
5.4.250.0270.07018.87
5.4.240.0230.04319.30
5.4.230.0230.06719.09
5.4.220.0270.07319.08
5.4.210.0270.05719.08
5.4.200.0270.06719.14
5.4.190.0230.04018.95
5.4.180.0200.03718.86
5.4.170.0200.07318.94
5.4.160.0200.04718.97
5.4.150.0270.04019.06
5.4.140.0270.03716.52
5.4.130.0230.06016.40
5.4.120.0170.06016.44
5.4.110.0200.05316.54
5.4.100.0200.04716.55
5.4.90.0130.04716.41
5.4.80.0270.06016.43
5.4.70.0230.07016.26
5.4.60.0170.05016.53
5.4.50.0170.07316.38
5.4.40.0270.05716.54
5.4.30.0170.07716.51
5.4.20.0170.07716.43
5.4.10.0200.06316.23
5.4.00.0300.06015.82
5.3.290.0230.03714.63
5.3.280.0200.06314.75
5.3.270.0300.05314.51
5.3.260.0170.07314.52
5.3.250.0270.04014.59
5.3.240.0270.07014.77
5.3.230.0270.06714.50
5.3.220.0130.04314.55
5.3.210.0200.05014.47
5.3.200.0200.05014.54
5.3.190.0300.05014.64
5.3.180.0200.04314.54
5.3.170.0170.05314.54
5.3.160.0230.04714.54
5.3.150.0230.03314.46
5.3.140.0270.06714.71
5.3.130.0230.06014.64
5.3.120.0170.04714.56
5.3.110.0270.07014.57
5.3.100.0230.06714.03
5.3.90.0270.06713.99
5.3.80.0330.06714.24
5.3.70.0270.04014.02
5.3.60.0270.04014.08
5.3.50.0230.07714.06
5.3.40.0270.06313.88
5.3.30.0270.06313.93
5.3.20.0370.06013.86
5.3.10.0270.06713.74
5.3.00.0170.06313.80
5.2.170.0200.05712.09
5.2.160.0230.05712.09
5.2.150.0170.06312.09
5.2.140.0200.05712.09
5.2.130.0230.04012.09
5.2.120.0300.04312.13
5.2.110.0200.04012.13
5.2.100.0170.05012.13
5.2.90.0270.05312.13
5.2.80.0200.06312.14
5.2.70.0230.05712.15
5.2.60.0100.05312.24
5.2.50.0200.03712.30
5.2.40.0170.05312.30
5.2.30.0130.06312.30
5.2.20.0170.06012.31
5.2.10.0270.05012.34
5.2.00.0200.05012.34
5.1.60.0170.03012.35
5.1.50.0200.04012.36
5.1.40.0170.05012.36
5.1.30.0170.05712.36
5.1.20.0170.03312.36
5.1.10.0170.05012.36
5.1.00.0070.04312.36
5.0.50.0070.04312.36
5.0.40.0030.04712.36
5.0.30.0130.03712.36
5.0.20.0170.03312.36
5.0.10.0100.03712.36
5.0.00.0100.05712.36
4.4.90.0070.03712.15
4.4.80.0170.02012.25
4.4.70.0070.03312.31
4.4.60.0100.03312.33
4.4.50.0070.03712.33
4.4.40.0100.05312.36
4.4.30.0100.03712.36
4.4.20.0100.03012.36
4.4.10.0070.03312.36
4.4.00.0100.03712.36
4.3.110.0100.03312.36
4.3.100.0170.03012.36
4.3.90.0100.03312.36
4.3.80.0070.04012.36
4.3.70.0100.02712.36
4.3.60.0070.03312.36
4.3.50.0070.02712.36
4.3.40.0070.05012.36
4.3.30.0000.03712.36
4.3.20.0070.02012.36
4.3.10.0030.03012.36
4.3.00.0070.03012.36

preferences:
47 ms | 400 KiB | 5 Q