3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $html = <<<HTML <form method="post" class="form" data-id="19" data-title="Schema" data-slug="schema" data-message-success="Success!" data-message-invalid-email="Not valid!" data-message-required-field-missing="All fields are required!" data-message-error="Error!"> --- Form content --- <div>with some tags</div> </form> HTML; $doc = new DOMDocument('1.0', 'UTF-8'); $doc->loadHTML($html); $xpath = new DOMXPath($doc); foreach ($xpath->query('//form') as $formTag) { // remove child nodes of the form tag foreach ([...$formTag->childNodes] as $child) { $formTag->removeChild($child); } // output as string, but remove the closing tag echo substr($doc->saveHTML($formTag), 0, -7); }

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.5.10.0110.00817.17
8.5.00.0170.00920.41
8.4.160.0110.01120.06
8.4.150.0020.00114.05
8.4.140.0140.00718.20
8.4.130.0140.00618.01
8.4.120.0140.00720.91
8.4.110.0110.00922.71
8.4.100.0070.00518.15
8.4.90.0150.00717.97
8.4.80.0060.00220.03
8.4.70.0040.00518.36
8.4.60.0040.00718.39
8.4.50.0040.00518.21
8.4.40.0100.01020.82
8.4.30.0040.01520.74
8.4.20.0160.00324.57
8.4.10.0140.00321.95
8.3.280.0110.00918.70
8.3.270.0080.00417.17
8.3.260.0030.00517.11
8.3.250.0040.00519.35
8.3.240.0040.00417.03
8.3.230.0140.00617.14
8.3.220.0130.00617.02
8.3.210.0170.00717.00
8.3.200.0120.00916.77
8.3.190.0140.00516.98
8.3.180.0040.00416.91
8.3.170.0120.00616.83
8.3.160.0090.01017.41
8.3.150.0130.00617.56
8.3.140.0040.00419.38
8.3.130.0030.00618.72
8.3.120.0040.01119.46
8.3.110.0040.00417.03
8.3.100.0030.00617.25
8.3.90.0060.00326.77
8.3.80.0060.00318.80
8.3.70.0110.01117.25
8.3.60.0060.00917.25
8.3.50.0140.00324.74
8.3.40.0120.00320.75
8.3.30.0130.00619.30
8.3.20.0050.00324.18
8.3.10.0060.00324.66
8.3.00.0000.00826.16
8.2.290.0130.00719.26
8.2.280.0130.00818.87
8.2.270.0160.00316.93
8.2.260.0040.00417.68
8.2.250.0080.00017.66
8.2.240.0050.00519.33
8.2.230.0060.00320.94
8.2.220.0070.00324.06
8.2.210.0000.00826.77
8.2.200.0030.00617.00
8.2.190.0070.01416.88
8.2.180.0090.00625.92
8.2.170.0120.00919.59
8.2.160.0090.00622.96
8.2.150.0000.01725.66
8.2.140.0050.00224.66
8.2.130.0080.00026.16
8.2.120.0030.00526.35
8.2.110.0060.00320.89
8.2.100.0060.00618.22
8.2.90.0050.00318.28
8.2.80.0040.00418.13
8.2.70.0000.00818.27
8.2.60.0050.00318.28
8.2.50.0000.00718.10
8.2.40.0040.00418.72
8.2.30.0080.00018.49
8.2.20.0030.00518.50
8.2.10.0000.00819.74
8.2.00.0000.00819.64
8.1.330.0130.00622.55
8.1.320.0090.01018.21
8.1.310.0110.00418.77
8.1.300.0140.00719.01
8.1.290.0120.00030.84
8.1.280.0030.01025.92
8.1.270.0060.00324.10
8.1.260.0070.00028.09
8.1.250.0050.00328.09
8.1.240.0130.00324.19
8.1.230.0110.00022.60
8.1.220.0000.00818.26
8.1.210.0000.00819.38
8.1.200.0070.00317.85
8.1.190.0060.00317.73
8.1.180.0000.00818.10
8.1.170.0030.00619.09
8.1.160.0030.00519.30
8.1.150.0000.00819.38
8.1.140.0030.00619.33
8.1.130.0040.00420.60
8.1.120.0000.00717.90
8.1.110.0040.00417.89
8.1.100.0050.00317.93
8.1.90.0040.00417.84
8.1.80.0040.00717.81
8.1.70.0000.00817.82
8.1.60.0050.00318.01
8.1.50.0080.00017.96
8.1.40.0080.00017.86
8.1.30.0040.00417.96
8.1.20.0040.00417.95
8.1.10.0080.00017.91
8.1.00.0060.00317.85
8.0.300.0050.00320.34
8.0.290.0080.00017.25
8.0.280.0000.00718.89
8.0.270.0070.00018.47
8.0.260.0050.00318.82
8.0.250.0040.00417.49
8.0.240.0000.00717.47
8.0.230.0040.00317.32
8.0.220.0070.00017.40
8.0.210.0000.00717.38
8.0.200.0000.00717.38
8.0.190.0040.00417.47
8.0.180.0080.00017.41
8.0.170.0090.00017.44
8.0.160.0040.00417.41
8.0.150.0040.00417.30
8.0.140.0060.00317.34
8.0.130.0000.00613.83
8.0.120.0040.00417.30
8.0.110.0000.00817.39
8.0.100.0000.00817.23
8.0.90.0050.00217.21
8.0.80.0050.01017.36
8.0.70.0030.00517.51
8.0.60.0000.00817.37
8.0.50.0000.00717.40
8.0.30.0180.00617.64
8.0.20.0110.00817.41
8.0.10.0000.00717.46
8.0.00.0070.01717.15
7.4.330.0030.00315.55
7.4.320.0040.00417.06
7.4.300.0040.00416.87
7.4.290.0040.00416.98
7.4.280.0080.00017.04
7.4.270.0070.00017.00
7.4.260.0050.00013.81
7.4.250.0040.00417.04
7.4.240.0040.00416.95
7.4.230.0000.00717.16
7.4.220.0070.00016.82
7.4.210.0090.00816.90
7.4.200.0000.00716.80
7.4.130.0090.01217.01
7.4.120.0090.00917.12
7.4.110.0090.00816.97
7.4.100.0060.01216.97
7.4.90.0070.01116.97
7.4.80.0060.01217.07
7.4.70.0060.01316.88
7.4.60.0160.00416.76
7.4.50.0130.00616.70
7.4.40.0160.00016.66
7.4.30.0070.01017.03
7.4.20.0080.01616.83
7.4.10.0100.00916.93
7.4.00.0180.00316.97
7.3.330.0000.00716.34
7.3.320.0060.00013.07
7.3.310.0050.00216.13
7.3.300.0070.00016.09
7.3.290.0060.01016.18
7.3.260.0120.00916.34
7.3.230.0030.01616.11
7.3.220.0070.01116.49
7.3.210.0140.01116.28
7.3.200.0090.00916.45
7.3.190.0100.00716.38
7.3.180.0090.00916.36
7.3.170.0060.01216.21
7.3.160.0150.00316.23
7.3.150.0100.00716.21
7.3.140.0130.00316.22
7.3.130.0100.00716.47
7.3.120.0080.00816.15
7.3.110.0070.01016.09
7.3.100.0090.00916.16
7.3.90.0060.01216.31
7.3.80.0130.00516.22
7.3.70.0060.01016.07
7.3.60.0060.01016.14
7.3.50.0100.01316.30
7.3.40.0090.00616.26
7.3.30.0130.00316.18
7.3.20.0170.00316.20
7.3.10.0070.01016.28
7.3.00.0120.00616.22
7.2.330.0160.00616.26
7.2.320.0040.01516.51
7.2.310.0140.00316.34
7.2.300.0070.01116.54
7.2.290.0090.00816.50
7.2.280.0060.01016.52
7.2.270.0030.02116.22
7.2.260.0100.00716.50
7.2.250.0110.00616.27
7.2.240.0110.00816.51
7.2.230.0090.00916.50
7.2.220.0100.00716.16
7.2.210.0030.01516.56
7.2.200.0030.01416.43
7.2.190.0030.01716.52
7.2.180.0000.01716.28
7.2.170.0130.00316.23
7.2.160.0080.00816.45
7.2.150.0090.00916.67
7.2.140.0090.00916.61
7.2.130.0150.00316.47
7.2.120.0100.00716.30
7.2.110.0070.01116.35
7.2.100.0150.00316.33
7.2.90.0060.01216.55
7.2.80.0100.00716.32
7.2.70.0100.00716.47
7.2.60.0140.00316.57
7.2.50.0140.00516.38
7.2.40.0100.00716.29
7.2.30.0100.00716.30
7.2.20.0110.00516.43
7.2.10.0130.00516.39
7.2.00.0100.00616.35

preferences:
39.38 ms | 403 KiB | 5 Q