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($arr[$i], "hidden") !== false){ echo $arr[$i]; unset($arr[$i]); } if(strpos($arr[$i], "<script") !== false){ while(strpos($arr[$i], "</script") === 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.0110.00416.87
8.3.50.0120.00316.63
8.3.40.0110.00418.62
8.3.30.0070.00718.85
8.3.20.0070.00720.34
8.3.10.0050.00321.76
8.3.00.0070.00417.72
8.2.180.0090.01225.92
8.2.170.0150.00622.96
8.2.160.0100.00320.35
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00020.75
8.2.120.0080.00026.35
8.2.110.0100.00622.31
8.2.100.0090.00317.91
8.2.90.0060.00317.97
8.2.80.0080.00019.11
8.2.70.0040.00417.75
8.2.60.0050.00317.75
8.2.50.0050.00318.10
8.2.40.0070.00020.26
8.2.30.0000.00819.38
8.2.20.0040.00418.19
8.2.10.0000.00718.00
8.2.00.0000.00718.07
8.1.280.0060.01225.92
8.1.270.0040.00422.19
8.1.260.0070.00326.35
8.1.250.0000.00728.09
8.1.240.0060.00319.07
8.1.230.0050.00520.95
8.1.220.0050.00317.78
8.1.210.0040.00718.77
8.1.200.0040.00417.36
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0000.00918.96
8.1.160.0040.00419.05
8.1.150.0040.00420.71
8.1.140.0040.00419.59
8.1.130.0000.00718.80
8.1.120.0070.00017.53
8.1.110.0050.00317.32
8.1.100.0000.00817.36
8.1.90.0000.00717.51
8.1.80.0070.00017.52
8.1.70.0050.00317.37
8.1.60.0030.00517.48
8.1.50.0080.00017.47
8.1.40.0050.00217.48
8.1.30.0040.00417.55
8.1.20.0030.00517.62
8.1.10.0000.00717.59
8.1.00.0080.00017.40
8.0.300.0050.00320.04
8.0.290.0040.00416.75
8.0.280.0030.00518.50
8.0.270.0050.00316.90
8.0.260.0000.00716.79
8.0.250.0030.00316.93
8.0.240.0000.00817.03
8.0.230.0040.00416.93
8.0.220.0050.00216.85
8.0.210.0000.00716.91
8.0.200.0040.00416.83
8.0.190.0040.00416.85
8.0.180.0030.00316.98
8.0.170.0040.00416.88
8.0.160.0070.00016.85
8.0.150.0050.00216.79
8.0.140.0050.00316.89
8.0.130.0060.00013.43
8.0.120.0000.00816.89
8.0.110.0040.00416.84
8.0.100.0000.00716.78
8.0.90.0000.00716.97
8.0.80.0070.01016.94
8.0.70.0040.00416.86
8.0.60.0040.00416.99
8.0.50.0040.00416.95
8.0.30.0100.00817.26
8.0.20.0100.00917.40
8.0.10.0070.00017.15
8.0.00.0110.00616.74
7.4.330.0000.00515.55
7.4.320.0020.00516.51
7.4.300.0030.00316.58
7.4.290.0040.00416.54
7.4.280.0030.00616.61
7.4.270.0030.00316.54
7.4.260.0000.00613.28
7.4.250.0040.00416.42
7.4.240.0000.00816.56
7.4.230.0070.00016.59
7.4.220.0150.00316.68
7.4.210.0140.00916.50
7.4.200.0040.00416.67
7.4.160.0130.00316.45
7.4.150.0100.01017.40
7.4.140.0150.00617.86
7.4.130.0170.00916.50
7.4.120.0100.00916.47
7.4.110.0130.00316.38
7.4.100.0060.01216.59
7.4.90.0070.01016.46
7.4.80.0210.01619.39
7.4.70.0030.02016.42
7.4.60.0100.01016.65
7.4.50.0060.00916.34
7.4.40.0100.00616.48
7.4.30.0070.01716.58
7.4.00.0030.01315.00
7.3.330.0070.00013.16
7.3.320.0030.00313.09
7.3.310.0030.00316.26
7.3.300.0030.00316.31
7.3.290.0000.00716.36
7.3.280.0070.01016.33
7.3.270.0120.00617.40
7.3.260.0120.00516.43
7.3.250.0140.00716.40
7.3.240.0130.00916.56
7.3.230.0110.00616.52
7.3.210.0080.00816.41
7.3.200.0070.01016.45
7.3.190.0100.00716.47
7.3.180.0130.00316.48
7.3.170.0120.00316.51
7.3.160.0090.00916.38
7.2.330.0170.00616.81
7.2.320.0060.01216.46
7.2.310.0070.01016.77
7.2.300.0140.00716.75
7.2.290.0100.00716.38
7.2.60.0190.01316.78
7.2.00.0000.00919.56
7.1.200.0030.00915.93
7.1.100.0070.00718.23
7.1.70.0050.01017.38
7.1.60.0260.00634.91
7.1.50.0230.01034.93
7.1.40.0180.02434.40
7.1.30.0240.01734.40
7.1.20.0230.01934.45
7.1.10.0060.01516.77
7.1.00.0040.01116.74
7.0.200.0030.01216.76
7.0.190.0070.00716.71
7.0.180.0040.01816.30
7.0.170.0060.01316.33
7.0.160.0030.01616.19
7.0.150.0080.01116.21
7.0.140.0080.01116.30
7.0.130.0070.00716.50
7.0.120.0090.00916.71
7.0.110.0110.00316.26
7.0.100.0040.01116.43
7.0.90.0040.01116.38
7.0.80.0140.00916.41
7.0.70.0060.01316.22
7.0.60.0060.01216.19
7.0.50.0080.01216.37
7.0.40.0040.01116.54
7.0.30.0000.01816.49
7.0.20.0060.01516.37
7.0.10.0100.01016.55
7.0.00.0030.01716.49

preferences:
54.24 ms | 400 KiB | 5 Q