3v4l.org

run code in 300+ PHP versions simultaneously
<?php $blah='test case: https://www.example.com/media/foo/bar.jpg https://www.example.com/media/cat/fish.jpg some text'; $image = 'fish.jpg'; $your_pattern = '/https:\/\/www\.example\.com\/media(.*)\/'.preg_quote($image).'/'; echo preg_match($your_pattern,$blah,$matches)?$matches[0]:'fail'; echo "\n----\n"; $my_pattern='~https://www\.example\.com/media(?:[^/\s]*/)+'.preg_quote($image).'~'; echo preg_match($my_pattern,$blah,$out)?$out[0]:'fail';

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.5.30.0070.00820.69
8.5.20.0080.00919.54
8.5.10.0100.00816.92
8.5.00.0140.00820.19
8.4.180.0110.01119.72
8.4.170.0120.01121.89
8.4.160.0150.00721.83
8.4.150.0060.00716.98
8.4.140.0130.00817.80
8.4.130.0130.00818.57
8.4.120.0120.00517.98
8.4.110.0040.00524.24
8.4.100.0130.00818.00
8.4.90.0130.00720.54
8.4.80.0140.00618.74
8.4.70.0160.00420.52
8.4.60.0120.00920.58
8.4.50.0080.00920.34
8.4.40.0130.00619.60
8.4.30.0060.01317.68
8.4.20.0080.00819.70
8.4.10.0060.00317.81
8.3.300.0140.00818.75
8.3.290.0140.00620.71
8.3.280.0130.00718.40
8.3.270.0080.01216.77
8.3.260.0090.01016.62
8.3.250.0140.00516.84
8.3.240.0140.00616.73
8.3.230.0050.00416.64
8.3.220.0120.00418.83
8.3.210.0120.00616.86
8.3.200.0050.00316.83
8.3.190.0100.00717.10
8.3.180.0110.00418.84
8.3.170.0160.00317.30
8.3.160.0100.01016.62
8.3.150.0080.01116.79
8.3.140.0130.00616.57
8.3.130.0080.00018.61
8.3.120.0060.00918.79
8.3.110.0200.00320.94
8.3.100.0030.00624.06
8.3.90.0000.00726.77
8.3.80.0060.00316.75
8.3.70.0070.01116.63
8.3.60.0070.01318.30
8.3.50.0120.00617.58
8.3.40.0080.00818.85
8.3.30.0070.01018.79
8.3.20.0050.00221.89
8.3.10.0080.00023.52
8.3.00.0040.00419.68
8.2.300.0100.00920.30
8.2.290.0100.00116.86
8.2.280.0090.01020.54
8.2.270.0160.00318.57
8.2.260.0120.00617.36
8.2.250.0000.00816.95
8.2.240.0090.00617.06
8.2.230.0030.00622.58
8.2.220.0030.00637.54
8.2.210.0160.00326.77
8.2.200.0090.00017.00
8.2.190.0080.00816.88
8.2.180.0040.01418.70
8.2.170.0180.00422.96
8.2.160.0030.01020.83
8.2.150.0070.00025.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00419.53
8.2.110.0000.00921.23
8.2.100.0040.00817.91
8.2.90.0080.00019.34
8.2.80.0080.00018.00
8.2.70.0060.00318.05
8.2.60.0030.00617.75
8.2.50.0050.00320.00
8.2.40.0040.00420.43
8.2.30.0000.00822.60
8.2.20.0050.00318.20
8.2.10.0040.00418.17
8.2.00.0080.00018.21
8.1.340.0100.00920.18
8.1.330.0130.00616.62
8.1.320.0130.00716.16
8.1.310.0040.01418.58
8.1.300.0050.00518.25
8.1.290.0070.00318.88
8.1.280.0060.00825.92
8.1.270.0080.00022.06
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0100.00324.01
8.1.230.0060.00617.77
8.1.220.0040.00417.74
8.1.210.0050.00518.77
8.1.200.0060.00317.48
8.1.190.0030.00517.35
8.1.180.0040.00418.10
8.1.170.0000.00918.63
8.1.160.0050.00318.89
8.1.150.0000.00821.93
8.1.140.0080.00017.75
8.1.130.0040.00419.06
8.1.120.0060.00317.49
8.1.110.0050.00317.58
8.1.100.0000.00717.51
8.1.90.0040.00417.47
8.1.80.0000.00817.52
8.1.70.0040.00417.64
8.1.60.0020.00517.63
8.1.50.0070.00317.64
8.1.40.0030.00517.69
8.1.30.0030.00517.71
8.1.20.0000.00817.71
8.1.10.0000.00817.62
8.1.00.0030.00517.55
8.0.300.0020.00518.77
8.0.290.0080.00016.88
8.0.280.0000.00818.47
8.0.270.0000.00816.89
8.0.260.0070.00016.88
8.0.250.0000.00717.03
8.0.240.0040.00417.06
8.0.230.0070.00017.15
8.0.220.0030.00316.89
8.0.210.0000.00716.94
8.0.200.0040.00417.09
8.0.190.0000.00717.04
8.0.180.0000.00816.96
8.0.170.0060.00316.89
8.0.160.0040.00417.04
8.0.150.0030.00316.95
8.0.140.0000.00716.89
8.0.130.0070.00013.47
8.0.120.0000.00716.99
8.0.110.0060.00317.10
8.0.100.0000.00716.95
8.0.90.0000.00717.07
8.0.80.0110.00417.02
8.0.70.0030.00517.11
8.0.60.0050.00316.88
8.0.50.0070.00316.88
8.0.30.0090.01017.20
8.0.20.0120.00817.44
8.0.10.0000.00717.22
8.0.00.0140.00616.88
7.4.330.0050.00015.55
7.4.320.0000.00716.59
7.4.300.0000.00616.66
7.4.290.0000.00716.67
7.4.280.0000.00816.63
7.4.270.0030.00616.80
7.4.260.0000.00716.67
7.4.250.0040.00416.64
7.4.240.0070.00016.63
7.4.230.0070.00016.56
7.4.220.0090.00016.68
7.4.210.0090.01016.73
7.4.200.0030.00316.67
7.4.160.0060.01116.67
7.4.150.0090.00917.40
7.4.140.0150.00417.86
7.4.130.0120.00616.92
7.4.120.0110.00716.71
7.4.110.0140.00316.66
7.4.100.0130.00316.61
7.4.90.0130.00616.77
7.4.80.0110.01119.39
7.4.70.0140.00416.88
7.4.60.0030.01616.67
7.4.50.0090.00216.47
7.4.40.0060.01616.54
7.4.00.0070.01015.11
7.3.330.0000.00713.32
7.3.320.0030.00313.23
7.3.310.0070.00016.53
7.3.300.0000.00716.41
7.3.290.0000.00716.34
7.3.280.0100.00816.30
7.3.270.0150.00317.40
7.3.260.0120.00616.50
7.3.240.0100.00816.42
7.3.230.0120.00916.69
7.3.210.0030.01816.52
7.3.200.0140.00316.41
7.3.190.0090.00816.54
7.3.180.0060.00916.69
7.3.170.0080.01116.46
7.3.160.0130.00316.54
7.3.10.0030.01216.79
7.3.00.0040.00816.82
7.2.330.0170.00016.80
7.2.320.0070.01016.90
7.2.310.0160.00316.76
7.2.300.0070.01016.54
7.2.290.0060.01016.57
7.2.130.0040.01117.15
7.2.120.0040.01217.04
7.2.110.0090.00417.24
7.2.100.0000.01317.15
7.2.90.0070.00716.99
7.2.80.0030.01017.12
7.2.70.0040.01117.14
7.2.60.0070.00716.89
7.2.50.0040.00817.18
7.2.40.0060.00317.03
7.2.30.0100.00316.93
7.2.20.0370.00517.54
7.2.10.0120.00817.65
7.2.00.0110.00917.66
7.1.250.0070.00316.12
7.1.200.0080.00416.01
7.1.140.0110.01117.07
7.1.130.0140.01217.08
7.1.120.0090.01716.85
7.1.110.0150.01015.98
7.1.100.0100.01116.20
7.1.90.0100.01316.42
7.1.80.0110.01216.74
7.1.70.0100.01315.47
7.1.60.0260.01433.62
7.1.50.0390.01533.21
7.1.40.0240.01332.82
7.1.30.0320.01732.88
7.1.20.0310.02032.92
7.1.10.0090.00814.80
7.1.00.0280.00817.18

preferences:
106.51 ms | 1471 KiB | 5 Q