3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!function_exists("str_ends_with")) { function str_ends_with($haystack, $needle) { return strrpos($haystack, $needle) === strlen($haystack) - strlen($needle); } } $urls = [ "https://www.example.gov.us/directory_1/directory_2/directory_3/index.php", "https://www.example.gov.us/directory_1/directory_2/directory_3/index", "https://www.example.gov.us/directory_1/directory_2/directory_3/" ]; foreach ($urls as $url) { printf( "From %s, got '%s'%s", $url, str_ends_with($url, "/") ? "" : basename($url), PHP_EOL ); }

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.4.120.0090.00820.58
8.4.110.0110.00622.48
8.4.100.0120.00817.66
8.4.90.0050.00318.52
8.4.80.0100.00617.81
8.4.70.0090.00717.75
8.4.60.0090.01118.53
8.4.50.0140.00717.56
8.4.40.0150.00619.13
8.4.30.0100.01020.48
8.4.20.0070.01317.83
8.4.10.0130.00720.37
8.3.250.0140.00519.03
8.3.240.0100.00916.64
8.3.230.0060.00416.49
8.3.220.0060.01118.95
8.3.210.0110.00716.63
8.3.200.0050.00416.40
8.3.190.0110.00816.98
8.3.180.0080.00818.75
8.3.170.0070.00716.55
8.3.160.0030.01417.42
8.3.150.0060.01217.25
8.3.140.0120.00416.61
8.3.130.0030.00518.36
8.3.120.0030.00620.64
8.3.110.0000.00820.94
8.3.100.0000.01016.64
8.3.90.0000.00726.77
8.3.80.0060.00316.63
8.3.70.0040.01116.58
8.3.60.0110.01118.18
8.3.50.0030.01420.07
8.3.40.0160.00318.77
8.3.30.0070.01019.36
8.3.20.0000.00824.18
8.3.10.0030.01024.66
8.3.00.0050.00326.16
8.2.290.0090.00122.20
8.2.280.0110.00618.32
8.2.270.0110.00718.88
8.2.260.0050.00316.79
8.2.250.0120.00617.14
8.2.240.0030.00716.93
8.2.230.0070.00322.58
8.2.220.0030.01724.06
8.2.210.0140.00026.77
8.2.200.0050.00516.38
8.2.190.0090.00916.58
8.2.180.0060.00925.92
8.2.170.0150.00319.00
8.2.160.0100.00322.96
8.2.150.0050.00325.66
8.2.140.0000.00824.66
8.2.130.0060.00326.16
8.2.120.0080.00019.38
8.2.110.0030.00620.84
8.2.100.0040.00717.78
8.2.90.0060.00317.72
8.2.80.0090.00017.97
8.2.70.0080.00017.63
8.2.60.0060.00317.93
8.2.50.0080.00018.07
8.2.40.0050.00658.96
8.2.30.0060.00317.96
8.2.20.0000.00720.47
8.2.10.0050.00218.00
8.2.00.0030.00619.11
8.1.330.0080.01023.88
8.1.320.0160.00916.13
8.1.310.0110.00716.72
8.1.300.0100.00015.90
8.1.290.0100.00030.84
8.1.280.0140.00325.92
8.1.270.0070.00723.99
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00322.51
8.1.230.0000.01120.90
8.1.220.0000.00817.74
8.1.210.0080.00018.94
8.1.200.0030.00617.47
8.1.190.0030.00517.23
8.1.180.0060.00318.10
8.1.170.0060.00318.65
8.1.160.0070.00018.91
8.1.150.0050.00218.55
8.1.140.0000.01117.36
8.1.130.0000.00717.45
8.1.120.0000.00717.43
8.1.110.0080.00017.46
8.1.100.0030.00617.42
8.1.90.0000.01017.51
8.1.80.0000.00717.34
8.1.70.0000.00717.26
8.1.60.0000.00917.47
8.1.50.0040.00417.45
8.1.40.0040.00417.54
8.1.30.0000.00917.63
8.1.20.0040.00417.63
8.1.10.0000.00817.37
8.1.00.0000.00817.34
8.0.300.0050.00319.86
8.0.290.0040.00416.75
8.0.280.0090.00020.29
8.0.270.0000.00718.06
8.0.260.0000.00616.86
8.0.250.0030.00316.89
8.0.240.0040.00416.82
8.0.230.0030.00316.97
8.0.220.0040.00416.76
8.0.210.0000.00816.87
8.0.200.0040.00416.97
8.0.190.0050.00316.89
8.0.180.0030.00516.92
8.0.170.0050.00316.92
8.0.160.0080.00016.74
8.0.150.0050.00216.86
8.0.140.0020.00516.68
8.0.130.0050.00316.78
8.0.120.0050.00216.80
8.0.110.0040.00416.77
8.0.100.0050.00216.81
8.0.90.0000.00816.70
8.0.80.0040.00416.88
8.0.70.0000.00716.90
8.0.60.0000.00716.82
8.0.50.0040.00416.74
8.0.30.0040.00416.92
8.0.20.0040.00416.82
8.0.10.0040.00416.91
7.4.330.0050.00015.55
7.4.320.0030.00316.49
7.4.300.0030.00516.48
7.4.290.0110.00016.41
7.4.280.0030.00516.50
7.4.270.0030.00316.59
7.4.260.0070.00016.61
7.4.250.0080.00016.54
7.4.240.0080.00016.49
7.4.230.0030.00316.47
7.4.220.0040.00416.62
7.4.210.0070.00016.61
7.4.200.0000.00816.46
7.4.190.0000.00716.60
7.4.180.0030.00316.63
7.4.160.0030.00316.64
7.4.150.0040.00416.54
7.4.140.0080.00016.52
7.4.130.0040.00416.32
7.4.120.0050.00316.52
7.4.110.0000.00716.50
7.4.100.0070.00016.51
7.4.90.0000.00716.43
7.4.80.0030.00316.46
7.4.70.0000.00716.43
7.4.60.0070.00016.57
7.4.50.0000.00716.29
7.4.40.0030.00316.35
7.4.30.0030.00316.52
7.4.20.0000.00816.57
7.4.10.0030.00316.47
7.4.00.0030.00316.41

preferences:
30.2 ms | 403 KiB | 5 Q