3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '<p class="example">example</p> <p class="example" style="visibility:hidden">example</p> <script type="text/javascript">var example = 1 ....other stuff.... </script>'; $arr = explode(PHP_EOL, $str); var_dump($arr); for($i = 0; $i < count($arr); $i++){ if(strpos("hidden", $arr[$i]) === false){ unset($arr[$i]); } if(strpos("<script", $arr[$i]) === false){ while(!strpos("</script", $arr[$i]) === false){ unset($arr[$i]); $i++; } } } $str = implode(PHP_EOL, $arr); echo $str; Echo substr_count(strip_tags($str), "example");

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.0060.00916.63
8.3.50.0160.00016.51
8.3.40.0060.00918.82
8.3.30.0110.00318.81
8.3.20.0050.00320.34
8.3.10.0040.00423.48
8.3.00.0060.00617.68
8.2.180.0100.01016.63
8.2.170.0090.00622.96
8.2.160.0120.00320.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00321.18
8.2.120.0040.00426.35
8.2.110.0030.00621.05
8.2.100.0090.00317.72
8.2.90.0000.00817.88
8.2.80.0080.00018.83
8.2.70.0030.00517.75
8.2.60.0000.01117.62
8.2.50.0000.00917.98
8.2.40.0050.00320.01
8.2.30.0020.00518.01
8.2.20.0030.00518.06
8.2.10.0040.00418.03
8.2.00.0040.00418.13
8.1.280.0060.00925.92
8.1.270.0040.00423.71
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.81
8.1.230.0000.01122.69
8.1.220.0040.00418.55
8.1.210.0040.00419.01
8.1.200.0050.00517.13
8.1.190.0030.00617.35
8.1.180.0030.00618.10
8.1.170.0000.00817.62
8.1.160.0040.00418.93
8.1.150.0040.00418.63
8.1.140.0000.00719.59
8.1.130.0040.00418.81
8.1.120.0000.00717.47
8.1.110.0060.00317.28
8.1.100.0030.00617.50
8.1.90.0000.00717.32
8.1.80.0070.00017.35
8.1.70.0050.00517.38
8.1.60.0000.00717.64
8.1.50.0000.00817.51
8.1.40.0030.00617.38
8.1.30.0000.00817.65
8.1.20.0040.00417.61
8.1.10.0040.00417.62
8.1.00.0050.00217.47
8.0.300.0070.00020.02
8.0.290.0000.00716.75
8.0.280.0040.00418.41
8.0.270.0070.00017.18
8.0.260.0030.00316.85
8.0.250.0000.00716.92
8.0.240.0040.00416.89
8.0.230.0090.00016.93
8.0.220.0030.00316.88
8.0.210.0040.00416.84
8.0.200.0100.00017.04
8.0.190.0030.00916.93
8.0.180.0000.00716.83
8.0.170.0030.00617.01
8.0.160.0040.00416.97
8.0.150.0040.00416.93
8.0.140.0050.00216.93
8.0.130.0000.00513.36
8.0.120.0050.00317.04
8.0.110.0040.00416.79
8.0.100.0050.00216.98
8.0.90.0070.00016.98
8.0.80.0060.00816.91
8.0.70.0040.00417.00
8.0.60.0070.00016.91
8.0.50.0070.00016.99
8.0.30.0100.00917.18
8.0.20.0090.01117.40
8.0.10.0040.00416.96
8.0.00.0100.00716.91
7.4.330.0050.00015.55
7.4.320.0000.00816.46
7.4.300.0030.00316.55
7.4.290.0000.00716.65
7.4.280.0040.00416.63
7.4.270.0000.00816.50
7.4.260.0000.00613.35
7.4.250.0030.00616.39
7.4.240.0000.00716.50
7.4.230.0000.00716.34
7.4.220.0070.01116.66
7.4.210.0090.01316.47
7.4.200.0030.00316.49
7.4.160.0120.00716.50
7.4.150.0040.01317.40
7.4.140.0100.01317.86
7.4.130.0190.00616.43
7.4.120.0110.00816.59
7.4.110.0030.01416.56
7.4.100.0120.00916.57
7.4.90.0170.00716.41
7.4.80.0130.01019.39
7.4.70.0150.00916.59
7.4.60.0070.01116.63
7.4.50.0120.00616.39
7.4.40.0070.01016.50
7.4.30.0060.01216.56
7.4.00.0040.01415.15
7.3.330.0000.00613.07
7.3.320.0060.00013.21
7.3.310.0030.00316.21
7.3.300.0080.00016.32
7.3.290.0100.00516.34
7.3.280.0110.00816.31
7.3.270.0090.00817.40
7.3.260.0160.00616.52
7.3.250.0110.00916.57
7.3.240.0130.00516.46
7.3.230.0110.00816.28
7.3.210.0100.00616.38
7.3.200.0090.00916.61
7.3.190.0130.00316.37
7.3.180.0070.00916.46
7.3.170.0160.00016.50
7.3.160.0100.00716.56
7.2.330.0070.01016.84
7.2.320.0110.00616.84
7.2.310.0040.01316.55
7.2.300.0130.01016.44
7.2.290.0080.00816.82
7.2.60.0090.00316.94
7.2.00.0040.01519.60
7.1.200.0040.01115.75
7.1.100.0000.01218.11
7.1.70.0000.01916.93
7.1.60.0230.01335.10
7.1.50.0230.01334.76
7.1.40.0190.01534.34
7.1.30.0260.00634.49
7.1.20.0160.01534.48
7.1.10.0040.01216.65
7.1.00.0000.01416.60
7.0.200.0100.00616.91
7.0.190.0100.00316.65
7.0.180.0050.01016.20
7.0.170.0040.01416.16
7.0.160.0030.01416.06
7.0.150.0090.01016.22
7.0.140.0030.01116.39
7.0.130.0120.00816.61
7.0.120.0100.01016.48
7.0.110.0070.01316.29
7.0.100.0040.01416.54
7.0.90.0120.00816.23
7.0.80.0120.00616.27
7.0.70.0100.00716.36
7.0.60.0090.00916.09
7.0.50.0090.00916.33
7.0.40.0120.00716.57
7.0.30.0140.00316.45
7.0.20.0110.00416.38
7.0.10.0050.01016.40
7.0.00.0030.01616.38

preferences:
57.25 ms | 401 KiB | 5 Q