3v4l.org

run code in 300+ PHP versions simultaneously
<?php $chunk = 'This is a very large text line I have ever seen in my life and I love it.'; $searchfor = 'I have'; $pattern = preg_quote($searchfor, '/'); $pattern = "/^.*?(.{1,10}$pattern.{1,10}).*$/m"; if(preg_match_all($pattern, $chunk, $matches)){ echo "Found matches:\n"; echo implode("\n", $matches[1]) . "\n"; } $searchfor = 'a very'; $pattern = preg_quote($searchfor, '/'); $pattern = "/^.*?(.{1,10}$pattern.{1,10}).*$/m"; if(preg_match_all($pattern, $chunk, $matches)){ echo "Found matches:\n"; echo implode("\n", $matches[1]) . "\n"; } $searchfor = 'and I'; $pattern = preg_quote($searchfor, '/'); $pattern = "/^.*?(.{1,10}$pattern.{1,10}).*$/m"; if(preg_match_all($pattern, $chunk, $matches)){ echo "Found matches:\n"; echo implode("\n", $matches[1]) . "\n"; }

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.130.0130.00817.67
8.4.120.0160.00520.46
8.4.110.0110.00918.74
8.4.100.0140.00718.00
8.4.90.0110.01017.96
8.4.80.0110.01017.98
8.4.70.0120.00818.08
8.4.60.0080.00218.66
8.4.50.0100.01019.65
8.4.40.0160.00319.74
8.4.30.0080.01217.64
8.4.20.0150.00620.58
8.4.10.0040.00418.17
8.3.260.0140.00516.86
8.3.250.0060.00218.86
8.3.240.0150.00416.79
8.3.230.0130.00416.87
8.3.220.0120.00817.11
8.3.210.0070.01016.73
8.3.200.0040.00517.10
8.3.190.0120.00816.54
8.3.180.0130.00819.07
8.3.170.0090.01217.18
8.3.160.0120.00618.38
8.3.150.0080.00020.68
8.3.140.0080.00016.66
8.3.130.0040.01118.71
8.3.120.0040.01520.67
8.3.110.0000.00820.94
8.3.100.0000.00924.06
8.3.90.0060.00926.77
8.3.80.0090.00017.97
8.3.70.0110.01116.88
8.3.60.0060.01218.43
8.3.50.0050.01118.31
8.3.40.0040.01218.96
8.3.30.0070.00718.84
8.3.20.0040.00419.25
8.3.10.0000.00821.91
8.3.00.0040.00420.71
8.2.290.0110.01020.47
8.2.280.0120.00618.76
8.2.270.0040.00417.03
8.2.260.0120.00318.48
8.2.250.0100.01016.79
8.2.240.0090.00017.44
8.2.230.0070.00422.58
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0080.00016.63
8.2.190.0060.00916.78
8.2.180.0090.00918.63
8.2.170.0120.00322.96
8.2.160.0100.00722.21
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00320.91
8.2.110.0060.00319.27
8.2.100.0120.00018.13
8.2.90.0080.00018.10
8.2.80.0040.00418.16
8.2.70.0000.00817.93
8.2.60.0030.00618.16
8.2.50.0040.00418.10
8.2.40.0000.00919.16
8.2.30.0050.00319.43
8.2.20.0040.00418.07
8.2.10.0030.00618.16
8.2.00.0030.00617.83
8.1.330.0070.00418.42
8.1.320.0110.00916.36
8.1.310.0180.00018.31
8.1.300.0070.01418.13
8.1.290.0040.00430.84
8.1.280.0110.00725.92
8.1.270.0080.00822.14
8.1.260.0120.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00321.01
8.1.230.0070.00422.75
8.1.220.0080.00017.74
8.1.210.0000.00919.21
8.1.200.0030.00617.47
8.1.190.0060.00617.36
8.1.180.0030.00518.10
8.1.170.0030.00618.84
8.1.160.0040.00418.95
8.1.150.0040.00418.88
8.1.140.0000.00722.21
8.1.130.0070.00020.44
8.1.120.0080.00017.70
8.1.110.0030.00517.65
8.1.100.0000.00817.54
8.1.90.0080.00317.61
8.1.80.0030.00517.55
8.1.70.0040.00417.64
8.1.60.0060.00317.66
8.1.50.0040.00417.60
8.1.40.0030.00517.68
8.1.30.0040.00717.68
8.1.20.0060.00317.74
8.1.10.0000.00817.77
8.1.00.0060.00317.70
8.0.300.0050.00219.64
8.0.290.0030.00616.75
8.0.280.0000.00718.50
8.0.270.0040.00417.26
8.0.260.0040.00418.50
8.0.250.0060.00317.04
8.0.240.0040.00417.08
8.0.230.0000.00717.14
8.0.220.0000.00717.11
8.0.210.0070.00017.04
8.0.200.0040.00417.11
8.0.190.0000.00717.18
8.0.180.0000.00817.03
8.0.170.0050.00317.10
8.0.160.0030.00617.10
8.0.150.0090.00016.93
8.0.140.0000.00717.01
8.0.130.0030.00313.50
8.0.120.0000.00717.02
8.0.110.0040.00417.14
8.0.100.0070.00017.06
8.0.90.0040.00416.98
8.0.80.0070.00917.00
8.0.70.0050.00317.19
8.0.60.0000.00817.09
8.0.50.0050.00217.01
8.0.30.0070.00917.23
8.0.20.0250.01517.40
8.0.10.0040.00417.16
8.0.00.0110.00717.08
7.4.330.0000.00615.55
7.4.320.0060.00016.59
7.4.300.0020.00516.74
7.4.290.0030.00316.70
7.4.280.0000.01016.69
7.4.270.0000.00716.61
7.4.260.0030.00316.64
7.4.250.0040.00416.76
7.4.240.0000.00816.69
7.4.230.0030.00316.54
7.4.220.0030.00516.68
7.4.210.0080.01016.74
7.4.200.0000.00716.59
7.4.160.0080.01016.79
7.4.140.0100.00917.86
7.4.130.0120.01216.89
7.4.120.0110.00816.76
7.4.110.0090.00916.70
7.4.100.0070.01016.82
7.4.90.0060.01216.65
7.4.80.0140.00319.39
7.4.70.0100.00716.69
7.4.60.0110.00416.56
7.4.50.0030.01316.64
7.4.40.0120.00816.79
7.4.00.0060.00914.94
7.3.330.0030.00313.20
7.3.320.0030.00313.28
7.3.310.0060.00316.27
7.3.300.0000.00816.32
7.3.290.0040.00416.25
7.3.280.0080.01016.44
7.3.260.0090.01016.60
7.3.240.0090.00816.75
7.3.230.0170.00016.45
7.3.210.0140.00316.62
7.3.200.0090.00916.86
7.3.190.0030.01316.89
7.3.180.0120.00916.54
7.3.170.0130.00416.75
7.3.160.0100.00716.48
7.2.330.0100.01617.04
7.2.320.0100.01516.75
7.2.310.0110.00716.58
7.2.300.0060.01016.55
7.2.290.0070.01116.95
7.2.110.0350.00514.99
7.2.100.0440.00314.82
7.2.90.0340.00614.56
7.2.80.0330.00614.91
7.2.70.0300.01215.39
7.2.60.0260.01315.20
7.2.50.0300.00615.34
7.2.40.0270.01015.03
7.2.30.0370.00315.41
7.2.20.0550.00315.08
7.2.10.0320.01415.16
7.2.00.0560.01415.14
7.1.230.0240.01213.83
7.1.220.0520.00614.12
7.1.210.0400.01013.88
7.1.200.0320.00714.09
7.1.190.0300.01014.02
7.1.180.0360.00313.85
7.1.170.0440.00314.14
7.1.160.0350.00314.28
7.1.150.0300.00714.18
7.1.140.0560.00414.07
7.1.130.0320.01014.17
7.1.120.0490.00714.10
7.1.110.0370.00714.23
7.1.100.1220.00714.22
7.1.90.0350.00614.23
7.1.80.0370.00714.00
7.1.70.0390.00413.78
7.1.60.0620.01032.07
7.1.50.0710.00732.32
7.1.40.0620.00632.13
7.1.30.0620.00332.02
7.1.20.0580.00332.00
7.1.10.0450.00014.04
7.1.00.0400.00613.87
5.6.380.0060.00914.73

preferences:
29.05 ms | 403 KiB | 5 Q