3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = "http://jennifer.com/arrest/def/101"; $pattern = '@^(?:http://)?([^/]+)@i'; preg_match($pattern, $subject, $matches); print_r($matches); $url = parse_url("http://www.jennifer.com/user/101/article"); print_r($url); preg_match('/\\\:[a-zA-Z0-9\_\-]+/', "/user/:id/article", $matches); print_r($matches); $pattern = "@^" . preg_replace('/\\\:[a-zA-Z0-9\_\-]+/', '([a-zA-Z0-9\-\_]+)', preg_quote('/user/:id/article')) . "$@D"; $matches = array(); $match = preg_match($pattern, '/users/101/article', $matches); print_r($match); $matches = explode('/', rtrim('/users/101/article', '/')); print_r($matches); $matches = explode('/', rtrim('/users/101/article', "/")); array_shift($matches); print_r($matches);

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.0170.00016.88
8.3.50.0070.01018.11
8.3.40.0090.00618.79
8.3.30.0040.01118.67
8.3.20.0100.00018.72
8.3.10.0000.00823.65
8.3.00.0040.00421.75
8.2.180.0070.00716.63
8.2.170.0110.00322.96
8.2.160.0100.00320.52
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0000.00819.89
8.2.120.0040.00426.35
8.2.110.0070.00321.13
8.2.100.0120.00017.97
8.2.90.0040.00419.07
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0080.00017.92
8.2.50.0030.00518.10
8.2.40.0040.00420.55
8.2.30.0040.00419.23
8.2.20.0070.00017.99
8.2.10.0040.00418.12
8.2.00.0040.00417.94
8.1.280.0100.01025.92
8.1.270.0000.00822.07
8.1.260.0060.00328.09
8.1.250.0040.00428.09
8.1.240.0060.00319.52
8.1.230.0030.00917.79
8.1.220.0060.00317.76
8.1.210.0040.00418.77
8.1.200.0070.00317.35
8.1.190.0040.00417.22
8.1.180.0080.00018.10
8.1.170.0050.00518.71
8.1.160.0070.00320.76
8.1.150.0070.00020.22
8.1.140.0000.00719.66
8.1.130.0030.00317.76
8.1.120.0070.00017.66
8.1.110.0000.00817.48
8.1.100.0050.00317.67
8.1.90.0040.00417.61
8.1.80.0040.00417.56
8.1.70.0060.00317.56
8.1.60.0000.00817.79
8.1.50.0030.00517.66
8.1.40.0000.00817.68
8.1.30.0000.00817.85
8.1.20.0040.00417.90
8.1.10.0000.00817.55
8.1.00.0000.00817.59
8.0.300.0030.00618.77
8.0.290.0050.00517.00
8.0.280.0040.00418.36
8.0.270.0040.00417.34
8.0.260.0030.00617.27
8.0.250.0050.00217.19
8.0.240.0030.00317.12
8.0.230.0040.00417.11
8.0.220.0030.00317.08
8.0.210.0040.00416.95
8.0.200.0100.00017.01
8.0.190.0040.00417.14
8.0.180.0080.00016.98
8.0.170.0040.00417.12
8.0.160.0030.00616.95
8.0.150.0050.00316.96
8.0.140.0070.00017.01
8.0.130.0060.00013.54
8.0.120.0040.00417.05
8.0.110.0050.00217.05
8.0.100.0040.00417.18
8.0.90.0040.00417.05
8.0.80.0060.01616.95
8.0.70.0030.00716.97
8.0.60.0040.00417.12
8.0.50.0030.00517.04
8.0.30.0090.01017.23
8.0.20.0110.01017.40
8.0.10.0040.00416.97
8.0.00.0090.00916.96
7.4.330.0060.00015.55
7.4.320.0000.00716.69
7.4.300.0060.00016.69
7.4.290.0040.00416.64
7.4.280.0050.00216.76
7.4.270.0030.00616.62
7.4.260.0000.00716.73
7.4.250.0050.00216.71
7.4.240.0030.00316.74
7.4.230.0030.00316.47
7.4.220.0150.00316.60
7.4.210.0070.01016.64
7.4.200.0040.00416.59
7.4.160.0070.00916.68
7.4.150.0120.00817.40
7.4.140.0090.00917.86
7.4.130.0090.00816.65
7.4.120.0080.01216.62
7.4.110.0100.00716.62
7.4.100.0110.00616.82
7.4.90.0100.00616.72
7.4.80.0060.01019.39
7.4.70.0070.01016.71
7.4.60.0040.01416.77
7.4.50.0070.01116.75
7.4.40.0090.00916.67
7.4.30.0090.00616.57
7.4.10.0070.01316.50
7.4.00.0060.01215.67
7.3.330.0000.00513.13
7.3.320.0020.00213.11
7.3.310.0040.00416.24
7.3.300.0000.00716.37
7.3.290.0100.00816.37
7.3.280.0100.00816.36
7.3.270.0090.01217.40
7.3.260.0100.00916.51
7.3.250.0110.00816.61
7.3.240.0140.00716.52
7.3.230.0100.00716.39
7.3.210.0130.00416.75
7.3.200.0100.00716.62
7.3.190.0080.00916.49
7.3.180.0060.00916.73
7.3.170.0120.00616.46
7.3.160.0110.00616.62
7.3.130.0070.01316.44
7.3.120.0070.01115.79
7.3.110.0130.00515.63
7.3.100.0110.00715.82
7.3.90.0050.01015.81
7.3.80.0070.00715.63
7.3.70.0070.00715.76
7.3.60.0050.01015.72
7.3.50.0030.00915.71
7.3.40.0030.01115.54
7.3.30.0070.00715.51
7.3.20.0050.00717.53
7.3.10.0030.00817.60
7.3.00.0100.00317.60
7.2.330.0030.01416.79
7.2.320.0060.01316.82
7.2.310.0090.01216.78
7.2.300.0080.01116.78
7.2.290.0040.01416.89
7.2.260.0030.01716.78
7.2.250.0090.01015.90
7.2.240.0040.01415.92
7.2.230.0100.00816.00
7.2.220.0080.00716.05
7.2.210.0060.00816.08
7.2.200.0060.00815.80
7.2.190.0080.00815.96
7.2.180.0070.00815.88
7.2.170.0030.01015.96
7.2.160.0050.00915.96
7.2.150.0030.01117.87
7.2.140.0030.01017.58
7.2.130.0040.01017.72
7.2.120.0050.00717.77
7.2.110.0040.00917.89
7.2.100.0070.00517.86
7.2.90.0060.00817.86
7.2.80.0080.00617.77
7.2.70.0080.00817.77
7.2.60.0080.00817.74
7.2.50.0060.00617.86
7.2.40.0050.01117.90
7.2.30.0070.00717.93
7.2.20.0060.01017.74
7.2.10.0080.00617.82
7.2.00.0030.01218.38
7.1.330.0060.01016.69
7.1.320.0080.00516.75
7.1.310.0080.00316.65
7.1.300.0030.00816.75
7.1.290.0040.00816.72
7.1.280.0030.01016.57
7.1.270.0050.01016.69
7.1.260.0130.00116.61
7.1.250.0020.01016.74
7.1.240.0050.00916.66
7.1.230.0040.00716.48
7.1.220.0030.01016.56
7.1.210.0070.00816.57
7.1.200.0100.00516.74
7.1.190.0050.00916.78
7.1.180.0050.00916.58
7.1.170.0080.00516.79
7.1.160.0050.00816.52
7.1.150.0050.00616.59
7.1.140.0030.01416.69
7.1.130.0050.00916.63
7.1.120.0090.00316.57
7.1.110.0090.00316.53
7.1.100.0030.01116.84
7.1.90.0050.01016.70
7.1.80.0040.01116.69
7.1.70.0070.00716.71
7.1.60.0100.00516.95
7.1.50.0060.00616.56
7.1.40.0060.00916.63
7.1.30.0050.01016.63
7.1.20.0070.00616.74
7.1.10.0140.00216.64
7.1.00.0040.03018.61
7.0.330.0040.00916.32
7.0.320.0080.00516.36
7.0.310.0080.00516.29
7.0.300.0050.00916.12
7.0.290.0040.01016.17
7.0.280.0050.00816.25
7.0.270.0070.00916.26
7.0.260.0060.00716.47
7.0.250.0080.00816.22
7.0.240.0050.00816.33
7.0.230.0050.01116.20
7.0.220.0050.00716.31
7.0.210.0020.00816.35
7.0.200.0060.00815.85
7.0.190.0060.00816.48
7.0.180.0090.00516.28
7.0.170.0040.01116.24
7.0.160.0060.00716.11
7.0.150.0080.00716.46
7.0.140.0020.01216.33
7.0.130.0090.00716.46
7.0.120.0040.02618.30
7.0.110.0060.02618.22
7.0.100.0070.02418.21
7.0.90.0080.02318.24
7.0.80.0100.01818.14
7.0.70.0080.02718.26
7.0.60.0080.02418.16
7.0.50.0060.02518.36
7.0.40.0010.02916.84
7.0.30.0060.02416.90
7.0.20.0030.02616.90
7.0.10.0020.03016.94
7.0.00.0110.03216.94
5.6.400.0100.00215.15
5.6.390.0050.00615.13
5.6.380.0090.00415.11
5.6.370.0080.00814.88
5.6.360.0030.01014.99
5.6.350.0070.00815.06
5.6.340.0100.00315.41
5.6.330.0050.01015.06
5.6.320.0070.00915.25
5.6.310.0020.01115.14
5.6.300.0070.00615.42
5.6.290.0050.00715.28
5.6.280.0070.00715.08
5.6.270.0100.02317.22
5.6.260.0090.02017.00
5.6.250.0090.02117.09
5.6.240.0090.02317.11
5.6.230.0000.03016.94
5.6.220.0110.02817.13
5.6.210.0090.02116.98
5.6.200.0070.02717.10
5.6.190.0070.02616.90
5.6.180.0130.02217.04
5.6.170.0060.02517.05
5.6.160.0080.02317.10
5.6.150.0090.02317.14
5.6.140.0090.02316.98
5.6.130.0100.02217.11
5.6.120.0060.02317.05
5.6.110.0070.02817.07
5.6.100.0090.02417.05
5.6.90.0110.02017.11
5.6.80.0090.02216.84
5.6.70.0090.02416.66
5.6.60.0100.02816.92
5.6.50.0080.02716.75
5.6.40.0090.02816.81
5.6.30.0100.02216.89
5.6.20.0090.02116.72
5.6.10.0060.02816.76
5.6.00.0070.02416.83

preferences:
33.68 ms | 401 KiB | 5 Q