3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "<div class='room'> <h1>This is a h1</h1> <p>This is a Paragraph</p> <h2>This is h2</h2> </div> <div class='room2'> <h1>This is a h1</h1> <p>This is a Paragraph</p> <h2>This is h2</h2> </div>"; $arr = explode(PHP_EOL, $str); $res =array(); Foreach($arr as $row){ If(strpos($row, "div") !== False){ $pos1 = strpos($row, "'")+1; $room = substr($row, $pos1, strpos($row, "'", $pos1)-$pos1); }Else{ $pos1 = strpos($row, "<")+1; $res[$room][substr($row, strpos($row, "<")+1, strpos($row, ">")-$pos1)] = trim(strip_tags($row)); } } Var_dump($res);

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.45
8.3.50.0090.00616.34
8.3.40.0150.00018.97
8.3.30.0160.00018.77
8.3.20.0060.00321.94
8.3.10.0080.00021.85
8.3.00.0100.00018.98
8.2.180.0120.00425.92
8.2.170.0070.01419.05
8.2.160.0130.00322.96
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0030.00726.16
8.2.120.0000.00819.97
8.2.110.0110.00021.18
8.2.100.0060.00617.91
8.2.90.0040.00417.97
8.2.80.0000.00818.22
8.2.70.0000.00817.75
8.2.60.0040.00417.75
8.2.50.0030.00618.10
8.2.40.0000.00820.63
8.2.30.0000.00819.38
8.2.20.0080.00018.13
8.2.10.0080.00018.06
8.2.00.0040.00418.06
8.1.280.0070.01125.92
8.1.270.0060.00323.96
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0070.00320.78
8.1.230.0030.01022.14
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0040.00417.48
8.1.190.0040.00417.23
8.1.180.0030.00718.10
8.1.170.0070.00418.57
8.1.160.0050.00218.89
8.1.150.0040.00422.05
8.1.140.0050.00319.59
8.1.130.0080.00017.46
8.1.120.0000.00717.44
8.1.110.0060.00317.45
8.1.100.0030.00517.39
8.1.90.0040.00417.46
8.1.80.0060.00317.48
8.1.70.0040.00417.53
8.1.60.0000.00817.64
8.1.50.0000.00817.44
8.1.40.0030.00617.41
8.1.30.0040.00417.59
8.1.20.0040.00417.57
8.1.10.0030.00517.51
8.1.00.0060.00317.40
8.0.300.0040.00419.94
8.0.290.0050.00316.75
8.0.280.0000.00718.38
8.0.270.0030.00317.32
8.0.260.0030.00316.82
8.0.250.0070.00016.96
8.0.240.0060.00317.09
8.0.230.0030.00317.06
8.0.220.0030.00317.00
8.0.210.0070.00016.99
8.0.200.0040.00416.90
8.0.190.0050.00316.89
8.0.180.0000.00817.03
8.0.170.0000.00716.95
8.0.160.0050.00216.84
8.0.150.0000.00816.89
8.0.140.0030.00416.92
8.0.130.0040.00413.37
8.0.120.0030.00516.95
8.0.110.0040.00417.00
8.0.100.0040.00417.01
8.0.90.0000.00716.88
8.0.80.0060.00916.95
8.0.70.0040.00416.97
8.0.60.0000.00716.82
8.0.50.0040.00416.95
8.0.30.0120.00517.12
8.0.20.0120.01017.40
8.0.10.0080.00016.98
8.0.00.0060.01216.86
7.4.330.0050.00015.55
7.4.320.0030.00316.54
7.4.300.0070.00016.61
7.4.290.0100.00016.38
7.4.280.0040.00416.41
7.4.270.0030.00316.41
7.4.260.0030.00313.28
7.4.250.0000.00816.53
7.4.240.0070.00016.46
7.4.230.0030.00316.52
7.4.220.0100.01016.52
7.4.210.0080.00616.56
7.4.200.0000.00716.56
7.4.160.0090.00716.47
7.4.150.0030.01317.40
7.4.140.0100.00817.86
7.4.130.0070.01116.63
7.4.120.0120.00816.58
7.4.110.0130.00316.59
7.4.100.0150.00616.43
7.4.90.0130.00316.76
7.4.80.0140.00319.39
7.4.70.0100.00616.41
7.4.60.0090.01016.45
7.4.50.0080.00616.26
7.4.40.0120.00916.40
7.4.30.0100.00616.47
7.4.10.0120.00615.18
7.4.00.0070.01114.96
7.3.330.0060.00013.09
7.3.320.0000.00513.17
7.3.310.0000.00716.47
7.3.300.0040.00416.22
7.3.290.0090.00716.29
7.3.280.0110.00616.35
7.3.270.0140.00517.40
7.3.260.0030.01416.62
7.3.250.0110.01116.50
7.3.240.0060.01116.34
7.3.230.0070.01116.37
7.3.210.0060.01116.41
7.3.200.0080.00816.44
7.3.190.0050.01116.34
7.3.180.0170.00016.64
7.3.170.0030.01916.72
7.3.160.0080.01216.42
7.3.130.0110.00614.78
7.3.120.0100.00714.85
7.3.110.0100.01015.05
7.3.100.0060.01014.81
7.3.90.0100.01015.14
7.3.80.0120.00914.66
7.3.70.0100.00314.89
7.3.60.0120.00314.92
7.3.50.0070.01014.97
7.3.40.0000.01114.91
7.3.30.0040.00414.96
7.3.20.0070.00716.66
7.3.10.0060.01216.59
7.3.00.0170.00016.72
7.2.330.0060.01316.56
7.2.320.0160.00016.43
7.2.310.0190.00016.43
7.2.300.0070.01016.67
7.2.290.0130.00616.41
7.2.260.0090.00915.28
7.2.250.0070.01114.97
7.2.240.0040.01115.01
7.2.230.0080.01215.06
7.2.220.0120.00614.98
7.2.210.0080.00814.80
7.2.200.0030.00815.18
7.2.190.0080.00415.01
7.2.180.0040.00814.90
7.2.170.0070.00715.18
7.2.160.0040.00815.05
7.2.150.0000.01717.03
7.2.140.0070.01017.00
7.2.130.0040.01116.75
7.2.120.0040.01216.75
7.2.110.0070.00716.90
7.2.100.0060.00316.77
7.2.90.0030.01317.16
7.2.80.0060.01017.06
7.2.70.0030.01017.02
7.2.60.0030.00916.87
7.2.50.0060.00917.06
7.2.40.0060.00917.06
7.2.30.0100.00316.89
7.2.20.0110.00616.95
7.2.10.0040.01116.84
7.2.00.0050.01218.20
7.1.330.0100.00315.61
7.1.320.0130.00315.74
7.1.310.0090.00415.99
7.1.300.0040.00715.70
7.1.290.0060.00315.58
7.1.280.0030.01015.83
7.1.270.0030.01015.80
7.1.260.0140.00415.81
7.1.250.0030.00615.74
7.1.240.0060.00615.56
7.1.230.0130.00315.69
7.1.220.0030.01315.59
7.1.210.0000.01515.71
7.1.200.0030.00915.88
7.1.190.0040.00715.64
7.1.180.0030.01015.71
7.1.170.0130.00315.82
7.1.160.0060.00915.55
7.1.150.0030.00915.83
7.1.140.0040.00815.86
7.1.130.0070.00715.55
7.1.120.0060.00915.90
7.1.110.0090.00315.64
7.1.100.0080.00716.90
7.1.90.0030.01215.81
7.1.80.0060.00915.47
7.1.70.0080.00516.51
7.1.60.0250.01124.34
7.1.50.0220.01224.46
7.1.40.0330.01224.13
7.1.30.0330.01024.13
7.1.20.0310.00824.24
7.1.10.0250.00715.28
7.1.00.0200.01215.40
7.0.330.0030.00615.43
7.0.320.0040.01115.42
7.0.310.0100.00715.21
7.0.300.0060.00615.45
7.0.290.0060.00315.45
7.0.280.0090.00315.20
7.0.270.0070.00715.30
7.0.260.0030.01015.25
7.0.250.0120.00315.56
7.0.240.0070.00715.36
7.0.230.0100.00315.37
7.0.220.0070.00715.34
7.0.210.0100.00315.48
7.0.200.0230.00815.37
7.0.190.0270.00515.21
7.0.180.0240.00914.92
7.0.170.0270.00515.03
7.0.160.0190.00815.04
7.0.150.0280.00715.12
7.0.140.0200.01215.16
7.0.130.0220.01215.18
7.0.120.0220.00715.02
7.0.110.0270.00715.13
7.0.100.0290.00714.94
7.0.90.0270.00515.07
7.0.80.0660.00514.99
7.0.70.0230.01015.06
7.0.60.0260.00914.88
7.0.50.0420.01014.90
7.0.40.0370.00914.09
7.0.30.0270.01114.01
7.0.20.0430.00813.80
7.0.10.0370.01214.05
7.0.00.0410.00814.05
5.6.400.0060.01214.61
5.6.390.0090.00414.09
5.6.380.0030.01014.41
5.6.370.0000.01114.30
5.6.360.0030.00714.66
5.6.350.0080.00414.71
5.6.340.0080.00314.43
5.6.330.0060.00914.80
5.6.320.0160.00014.39
5.6.310.0100.00314.62
5.6.300.0040.00714.65
5.6.290.0090.00614.11
5.6.280.0070.00714.22
5.6.270.0070.00414.57
5.6.260.0000.01314.41
5.6.250.0040.00814.40
5.6.240.0000.01514.23
5.6.230.0100.00714.30
5.6.220.0070.00314.48
5.6.210.0060.00614.30
5.6.200.0000.01414.13
5.6.190.0030.01014.23
5.6.180.0030.00714.16
5.6.170.0070.00714.24
5.6.160.0040.01114.19
5.6.150.0100.00714.20
5.6.140.0040.01114.65
5.6.130.0100.00714.42
5.6.120.0040.00414.48
5.6.110.0060.00614.31
5.6.100.0000.01414.52
5.6.90.0040.00414.70
5.6.80.0030.01014.30
5.6.70.0060.00614.33
5.6.60.0090.00314.26
5.6.50.0030.01214.50
5.6.40.0070.01014.24
5.6.30.0040.00814.25
5.6.20.0000.01414.27
5.6.10.0040.01114.36
5.6.00.0070.00414.29

preferences:
57.17 ms | 401 KiB | 5 Q