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 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.0090.00616.75
8.3.50.0070.01016.34
8.3.40.0030.01318.78
8.3.30.0040.01118.72
8.3.20.0040.00420.29
8.3.10.0100.00023.57
8.3.00.0070.00417.84
8.2.180.0150.00316.63
8.2.170.0070.00722.96
8.2.160.0130.00320.11
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00021.05
8.2.120.0080.00026.35
8.2.110.0060.00321.18
8.2.100.0090.00318.03
8.2.90.0090.00018.27
8.2.80.0040.00417.97
8.2.70.0000.00818.04
8.2.60.0060.00318.05
8.2.50.0030.00618.10
8.2.40.0100.00022.09
8.2.30.0000.00819.23
8.2.20.0000.01018.00
8.2.10.0000.00718.21
8.2.00.0000.00718.11
8.1.280.0110.00425.92
8.1.270.0050.00323.80
8.1.260.0000.00726.35
8.1.250.0030.00528.09
8.1.240.0040.01117.52
8.1.230.0070.00420.89
8.1.220.0040.00417.79
8.1.210.0000.00920.82
8.1.200.0050.00517.22
8.1.190.0080.00017.22
8.1.180.0000.00818.10
8.1.170.0040.00817.95
8.1.160.0040.00418.92
8.1.150.0000.00718.94
8.1.140.0040.00419.63
8.1.130.0070.00019.28
8.1.120.0070.00017.36
8.1.110.0050.00317.37
8.1.100.0000.00917.34
8.1.90.0040.00417.46
8.1.80.0040.00317.35
8.1.70.0050.00617.36
8.1.60.0080.00017.50
8.1.50.0040.00417.51
8.1.40.0000.00717.41
8.1.30.0030.00517.61
8.1.20.0040.00417.66
8.1.10.0000.00817.52
8.1.00.0030.00617.51
8.0.300.0000.00719.60
8.0.290.0000.00816.63
8.0.280.0070.00018.36
8.0.270.0030.00317.30
8.0.260.0000.00816.88
8.0.250.0030.00317.07
8.0.240.0080.00016.98
8.0.230.0040.00416.88
8.0.220.0070.00016.84
8.0.210.0030.00316.79
8.0.200.0000.00716.85
8.0.190.0070.00316.96
8.0.180.0000.00716.93
8.0.170.0000.00816.98
8.0.160.0040.00317.00
8.0.150.0040.00416.92
8.0.140.0000.00816.88
8.0.130.0030.00313.48
8.0.120.0000.00716.91
8.0.110.0040.00416.85
8.0.100.0050.00417.02
8.0.90.0000.00716.86
8.0.80.0110.00616.91
8.0.70.0040.00416.85
8.0.60.0000.00716.90
8.0.50.0070.00016.96
8.0.30.0110.00717.17
8.0.20.0110.00917.40
8.0.10.0040.00416.87
8.0.00.0000.01716.99
7.4.330.0000.00515.55
7.4.320.0030.00316.53
7.4.300.0070.00016.57
7.4.290.0040.00416.61
7.4.280.0040.00416.51
7.4.270.0000.00716.50
7.4.260.0030.00313.39
7.4.250.0030.00616.50
7.4.240.0000.00716.59
7.4.230.0030.00316.63
7.4.220.0090.01316.52
7.4.210.0050.01616.63
7.4.200.0070.00016.42
7.4.160.0120.00516.55
7.4.150.0150.00317.40
7.4.140.0130.00817.86
7.4.130.0090.00916.59
7.4.120.0070.01316.64
7.4.110.0100.00716.54
7.4.100.0100.01016.59
7.4.90.0070.01116.62
7.4.80.0130.00619.39
7.4.70.0090.01416.45
7.4.60.0080.00816.55
7.4.50.0080.00616.26
7.4.40.0140.00716.38
7.4.30.0120.00616.46
7.4.10.0040.01215.11
7.4.00.0070.00915.01
7.3.330.0050.00013.20
7.3.320.0050.00013.12
7.3.310.0040.00416.25
7.3.300.0070.00016.26
7.3.290.0060.01016.35
7.3.280.0100.00816.32
7.3.270.0070.01017.40
7.3.260.0110.01316.54
7.3.250.0120.00916.53
7.3.240.0110.00916.56
7.3.230.0100.01016.49
7.3.210.0040.01316.64
7.3.200.0140.00916.27
7.3.190.0100.00616.57
7.3.180.0080.00816.37
7.3.170.0130.00616.56
7.3.160.0120.00916.55
7.3.130.0000.01814.97
7.3.120.0100.00714.84
7.3.110.0060.01014.93
7.3.100.0090.00614.81
7.3.90.0120.00414.89
7.3.80.0060.00914.81
7.3.70.0060.00614.68
7.3.60.0070.00714.91
7.3.50.0080.00614.76
7.3.40.0050.00914.78
7.3.30.0060.00714.74
7.3.20.0050.01016.68
7.3.10.0080.00916.62
7.3.00.0080.00516.55
7.2.330.0090.00916.60
7.2.320.0110.00616.80
7.2.310.0100.01416.40
7.2.300.0160.00316.49
7.2.290.0070.01316.57
7.2.260.0090.00915.04
7.2.250.0080.01015.17
7.2.240.0080.01115.07
7.2.230.0040.01215.14
7.2.220.0030.01214.90
7.2.210.0010.01215.00
7.2.200.0110.00215.13
7.2.190.0080.00415.13
7.2.180.0050.00915.06
7.2.170.0100.00614.98
7.2.160.0040.01114.92
7.2.150.0050.01116.84
7.2.140.0070.01017.01
7.2.130.0090.00616.89
7.2.120.0080.00616.86
7.2.110.0080.00816.82
7.2.100.0080.00716.93
7.2.90.0090.00716.96
7.2.80.0060.00816.89
7.2.70.0070.00717.00
7.2.60.0090.00616.85
7.2.50.0060.00816.85
7.2.40.0080.00616.93
7.2.30.0070.00716.98
7.2.20.0050.00816.90
7.2.10.0070.00816.88
7.2.00.0070.00617.20
7.1.330.0080.00715.67
7.1.320.0060.00515.60
7.1.310.0070.00315.72
7.1.300.0070.00715.84
7.1.290.0050.01115.75
7.1.280.0080.00415.74
7.1.270.0070.00415.85
7.1.260.0080.00715.85
7.1.250.0100.00615.85
7.1.240.0060.00715.71
7.1.230.0050.00615.78
7.1.220.0040.00815.77
7.1.210.0050.00815.74
7.1.200.0080.00515.74
7.1.190.0060.00715.79
7.1.180.0030.00915.73
7.1.170.0040.00815.73
7.1.160.0020.01115.80
7.1.150.0050.00815.72
7.1.140.0050.00815.77
7.1.130.0050.00615.73
7.1.120.0050.00715.78
7.1.110.0050.00715.80
7.1.100.0040.00916.10
7.1.90.0040.00915.87
7.1.80.0060.00515.80
7.1.70.0050.00916.05
7.1.60.0120.00819.01
7.1.50.0120.00719.03
7.1.40.0080.00618.85
7.1.30.0080.00818.94
7.1.20.0080.00818.91
7.1.10.0090.00515.88
7.1.00.0060.00616.01
7.0.330.0040.00615.31
7.0.320.0030.00915.39
7.0.310.0030.01015.37
7.0.300.0030.00915.38
7.0.290.0050.00815.39
7.0.280.0050.00715.47
7.0.270.0070.00615.41
7.0.260.0060.00615.38
7.0.250.0050.00815.53
7.0.240.0040.00815.42
7.0.230.0070.00515.23
7.0.220.0070.00515.43
7.0.210.0030.00815.38
7.0.200.0050.00815.61
7.0.190.0040.00815.64
7.0.180.0070.00615.55
7.0.170.0040.00715.47
7.0.160.0070.00615.58
7.0.150.0050.00815.48
7.0.140.0050.00915.52
7.0.130.0060.00815.57
7.0.120.0070.00615.68
7.0.110.0040.00815.56
7.0.100.0050.00815.62
7.0.90.0050.00715.57
7.0.80.0050.00815.55
7.0.70.0050.00715.54
7.0.60.0050.00815.57
7.0.50.0050.00715.60
7.0.40.0050.00813.95
7.0.30.0070.00814.02
7.0.20.0040.00813.93
7.0.10.0060.00814.01
7.0.00.0070.00413.97
5.6.400.0070.00714.46
5.6.390.0040.00514.41
5.6.380.0040.00814.36
5.6.370.0050.00914.38
5.6.360.0050.00614.42
5.6.350.0090.00614.52
5.6.340.0090.00514.28
5.6.330.0060.00914.64
5.6.320.0070.00514.33
5.6.310.0080.00614.66
5.6.300.0020.01314.73
5.6.290.0030.01014.51
5.6.280.0040.00814.51
5.6.270.0100.00514.47
5.6.260.0080.00714.39
5.6.250.0070.00914.39
5.6.240.0020.01214.64
5.6.230.0040.00814.37
5.6.220.0060.00614.32
5.6.210.0100.00314.38
5.6.200.0060.00714.45
5.6.190.0050.01014.42
5.6.180.0020.00914.44
5.6.170.0030.00914.41
5.6.160.0100.00414.43
5.6.150.0100.00214.35
5.6.140.0080.00614.50
5.6.130.0090.00514.55
5.6.120.0070.00514.18
5.6.110.0050.00814.25
5.6.100.0050.00714.37
5.6.90.0090.00314.22
5.6.80.0030.00814.29
5.6.70.0030.00814.37
5.6.60.0070.00714.24
5.6.50.0060.00814.37
5.6.40.0080.00414.26
5.6.30.0060.00614.43
5.6.20.0080.00514.13
5.6.10.0040.00914.12
5.6.00.0060.00714.42

preferences:
51.54 ms | 401 KiB | 5 Q