3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$input = "I don't want this piece. This is the sentence I want. In don't want this piece either"; $input = "I don't want this piece! This is the <a href='https://example.com/my-sentence'>sentence</a> I want. In don't want this piece either"; $filter = "sentence"; $regex = '~\b(?:[^.?!]|https?://[^<>\s"\']++)*?'.preg_quote($filter, '~').'(?:[^.?!]|https?://[^<>\s"\']++)*~u'; if (preg_match_all($regex, $input, $match)){ print_r( array_map(function($x) {return strip_tags($x);}, $match[0]) ); }

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.0120.00318.68
8.3.50.0110.00420.11
8.3.40.0090.00621.88
8.3.30.0090.00618.96
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0000.00826.16
8.2.180.0140.00725.92
8.2.170.0060.01219.21
8.2.160.0110.00422.96
8.2.150.0000.00825.66
8.2.140.0070.00024.66
8.2.130.0030.00626.16
8.2.120.0070.00021.02
8.2.110.0070.00322.34
8.2.100.0120.00019.27
8.2.90.0040.00418.13
8.2.80.0000.00819.07
8.2.70.0040.00417.88
8.2.60.0040.00418.05
8.2.50.0030.00718.07
8.2.40.0040.00420.25
8.2.30.0000.00718.34
8.2.20.0040.00420.36
8.2.10.0060.00318.17
8.2.00.0040.00419.43
8.1.280.0000.01525.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.68
8.1.230.0110.00419.08
8.1.220.0050.00317.74
8.1.210.0090.00018.77
8.1.200.0070.00317.50
8.1.190.0040.00417.48
8.1.180.0040.00419.25
8.1.170.0000.00818.63
8.1.160.0030.00519.06
8.1.150.0040.00418.94
8.1.140.0040.00417.73
8.1.130.0040.00417.65
8.1.120.0080.00017.64
8.1.110.0000.00917.59
8.1.100.0040.00417.64
8.1.90.0040.00417.67
8.1.80.0040.00417.52
8.1.70.0040.00417.54
8.1.60.0000.00917.80
8.1.50.0040.00417.58
8.1.40.0080.00017.72
8.1.30.0110.00017.65
8.1.20.0030.00617.86
8.1.10.0190.00717.67
8.1.00.0190.00617.69
8.0.300.0040.00419.73
8.0.290.0000.00716.75
8.0.280.0030.00618.45
8.0.270.0030.00618.19
8.0.260.0000.00716.95
8.0.250.0050.00317.21
8.0.240.0030.00317.14
8.0.230.0050.00217.17
8.0.220.0000.00817.07
8.0.210.0000.00817.09
8.0.200.0000.00817.08
8.0.190.0050.00317.21
8.0.180.0030.00517.10
8.0.170.0030.00617.13
8.0.160.0000.00817.08
8.0.150.0000.00717.11
8.0.140.0000.00817.02
8.0.130.0160.00517.03
8.0.120.0180.00617.07
8.0.110.0170.00617.09
8.0.100.0160.00817.06
8.0.90.0160.00517.07
8.0.80.0130.00817.03
8.0.70.0160.00617.10
8.0.60.0180.00317.07
8.0.50.0190.00016.93
8.0.30.0200.00417.19
8.0.20.0160.00617.30
8.0.10.0180.00317.23
8.0.00.0140.00017.30
7.4.330.0000.00515.55
7.4.320.0090.00016.84
7.4.300.0040.00416.79
7.4.290.0000.01116.81
7.4.280.0000.00716.88
7.4.270.0120.00216.79
7.4.260.0210.00416.88
7.4.250.0250.00016.86
7.4.240.0140.00916.80
7.4.230.0200.00316.90
7.4.220.0160.00616.89
7.4.210.0130.00716.63
7.4.200.0200.00016.64
7.4.190.0120.00816.87
7.4.180.0180.00316.54
7.4.160.0170.00416.77
7.4.150.0160.00316.85
7.4.140.0200.00016.74
7.4.130.0160.00316.75
7.4.120.0160.00316.80
7.4.110.0150.00616.66
7.4.100.0100.01116.86
7.4.90.0150.00616.72
7.4.80.0130.00716.64
7.4.70.0170.00316.73
7.4.60.0180.00316.64
7.4.50.0180.00016.77
7.4.40.0140.00316.58
7.4.30.0100.00816.80
7.4.20.0080.00416.65
7.4.10.0000.00816.79
7.4.00.0090.00516.68
7.3.330.0130.00016.37
7.3.320.0060.00516.46
7.3.310.0180.00016.57
7.3.300.0210.00016.56
7.3.290.0100.00716.27
7.3.280.0150.00816.31
7.3.270.0180.00416.22
7.3.260.0160.00616.51
7.3.250.0160.00516.46
7.3.240.0150.00516.44
7.3.230.0140.00716.51
7.3.220.0160.00616.53
7.3.210.0190.00316.51
7.3.200.0160.00716.39
7.3.190.0180.00416.50
7.3.180.0210.00316.49
7.3.170.0040.01116.19
7.3.160.0140.00816.35
7.3.150.0130.00916.34
7.3.140.0140.00816.46
7.3.130.0190.00416.48

preferences:
56.41 ms | 400 KiB | 5 Q