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); 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 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.0040.01116.63
8.3.50.0100.00616.50
8.3.40.0070.01018.85
8.3.30.0110.00418.90
8.3.20.0140.00020.34
8.3.10.0030.00623.52
8.3.00.0080.00417.91
8.2.180.0100.00716.63
8.2.170.0070.00722.96
8.2.160.0140.00022.08
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0070.00019.95
8.2.110.0000.01020.57
8.2.100.0080.00317.84
8.2.90.0030.00619.36
8.2.80.0080.00018.05
8.2.70.0100.00017.75
8.2.60.0030.00717.93
8.2.50.0000.00818.10
8.2.40.0050.00322.14
8.2.30.0040.00421.06
8.2.20.0000.00818.10
8.2.10.0030.00518.20
8.2.00.0000.00718.18
8.1.280.0070.00725.92
8.1.270.0040.00423.94
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0090.00022.72
8.1.230.0070.00419.11
8.1.220.0040.00417.78
8.1.210.0060.00318.77
8.1.200.0060.00317.22
8.1.190.0040.00417.11
8.1.180.0040.00418.10
8.1.170.0000.01018.46
8.1.160.0050.00218.89
8.1.150.0000.00718.93
8.1.140.0040.00419.58
8.1.130.0000.00717.37
8.1.120.0040.00417.36
8.1.110.0050.00317.51
8.1.100.0080.00017.36
8.1.90.0070.00017.47
8.1.80.0040.00417.48
8.1.70.0100.00017.32
8.1.60.0030.00517.64
8.1.50.0030.00517.50
8.1.40.0080.00017.42
8.1.30.0030.00517.67
8.1.20.0040.00417.68
8.1.10.0030.00617.49
8.1.00.0030.00617.48
8.0.300.0040.00418.77
8.0.290.0060.00316.88
8.0.280.0030.00318.37
8.0.270.0000.00717.33
8.0.260.0030.00316.95
8.0.250.0070.00017.02
8.0.240.0030.00416.95
8.0.230.0060.00316.88
8.0.220.0000.00716.86
8.0.210.0070.00016.84
8.0.200.0080.00016.91
8.0.190.0070.00316.86
8.0.180.0040.00416.93
8.0.170.0030.00316.91
8.0.160.0000.00817.02
8.0.150.0000.00717.00
8.0.140.0000.00716.90
8.0.130.0050.00013.39
8.0.120.0000.00716.97
8.0.110.0070.00016.81
8.0.100.0000.00716.85
8.0.90.0000.00716.85
8.0.80.0030.01416.95
8.0.70.0040.00416.77
8.0.60.0000.00716.89
8.0.50.0040.00417.02
8.0.30.0090.01117.11
8.0.20.0130.01017.40
8.0.10.0000.00816.97
8.0.00.0060.01216.92
7.4.330.0020.00215.55
7.4.320.0030.00316.54
7.4.300.0030.00316.61
7.4.290.0040.00416.61
7.4.280.0000.00716.65
7.4.270.0030.00316.66
7.4.260.0020.00213.24
7.4.250.0030.00616.58
7.4.240.0000.00716.59
7.4.230.0030.00316.64
7.4.220.0160.00316.58
7.4.210.0060.01016.61
7.4.200.0040.00416.61
7.4.160.0050.01116.52
7.4.150.0040.01817.40
7.4.140.0120.00817.86
7.4.130.0110.00816.65
7.4.120.0090.00816.58
7.4.110.0090.00616.52
7.4.100.0060.01316.43
7.4.90.0130.00316.52
7.4.80.0060.01019.39
7.4.70.0130.00816.60
7.4.60.0090.00916.40
7.4.50.0100.00316.52
7.4.40.0060.01016.50
7.4.30.0070.01016.51
7.4.00.0070.00714.98
7.3.330.0000.00613.22
7.3.320.0060.00013.29
7.3.310.0000.00616.17
7.3.300.0030.00816.13
7.3.290.0090.00616.33
7.3.280.0070.01116.33
7.3.270.0100.00717.40
7.3.260.0070.01216.37
7.3.250.0120.01016.42
7.3.240.0070.01016.45
7.3.230.0130.00616.41
7.3.210.0120.00616.38
7.3.200.0120.00616.61
7.3.190.0030.01416.41
7.3.180.0130.00316.33
7.3.170.0160.00016.50
7.3.160.0070.01516.36
7.3.10.0100.00316.65
7.3.00.0030.01016.45
7.2.330.0140.01116.65
7.2.320.0120.00616.46
7.2.310.0130.00916.59
7.2.300.0090.01216.76
7.2.290.0130.00416.84
7.2.130.0060.00616.83
7.2.120.0050.00616.95
7.2.110.0080.00616.88
7.2.100.0050.00616.90
7.2.90.0110.00516.93
7.2.80.0080.00516.97
7.2.70.0050.01116.83
7.2.60.0070.00816.76
7.2.50.0050.00917.05
7.2.40.0080.00617.04
7.2.30.0040.00816.90
7.2.20.0060.01016.95
7.2.10.0070.00916.96
7.2.00.0050.00717.64
7.1.250.0070.00615.83
7.1.240.0070.00715.79
7.1.230.0070.00315.82
7.1.220.0100.00615.91
7.1.210.0070.00715.98
7.1.200.0060.00615.83
7.1.190.0000.00815.92
7.1.180.0090.00615.53
7.1.170.0070.00316.01
7.1.160.0060.00615.71
7.1.150.0090.00315.70
7.1.140.0040.00415.64
7.1.130.0070.00715.86
7.1.120.0060.00615.58
7.1.110.0000.01315.77
7.1.100.0060.00917.13
7.1.90.0080.00316.01
7.1.80.0060.00915.98
7.1.70.0060.00916.64
7.1.60.0120.01725.61
7.1.50.0190.01125.30
7.1.40.0150.01425.17
7.1.30.0130.01525.04
7.1.20.0190.00925.26
7.1.10.0170.00116.20
7.1.00.0050.00916.32
7.0.330.0090.00315.15
7.0.320.0060.00315.10
7.0.310.0070.00715.50
7.0.300.0070.01115.32
7.0.290.0000.01315.38
7.0.280.0090.00315.27
7.0.270.0040.00815.32
7.0.260.0030.00415.57
7.0.250.0000.01415.44
7.0.240.0060.00315.46
7.0.230.0030.01215.41
7.0.220.0050.00515.05
7.0.210.0040.00415.55
7.0.200.0050.01316.19
7.0.190.0030.01316.16
7.0.180.0080.00915.69
7.0.170.0050.01215.97
7.0.160.0080.01115.81
7.0.150.0100.01015.80
7.0.140.0080.00715.72
7.0.130.0090.00816.14
7.0.120.0080.00716.09
7.0.110.0070.00816.03
7.0.100.0040.00915.87
7.0.90.0040.00716.02
7.0.80.0080.00616.01
7.0.70.0110.00615.92
7.0.60.0050.00915.81
7.0.50.0050.00915.99
7.0.40.0090.00915.05
7.0.30.0110.00414.94
7.0.20.0090.00614.74
7.0.10.0050.01014.95
7.0.00.0070.00614.96
5.6.380.0040.00414.34

preferences:
59 ms | 401 KiB | 5 Q