3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Create a DOM Document $dom = new DomDocument(); // Load your HTML $dom->loadHTML('<form class="search-form"> <meta itemprop="target"> <input type="search"> <input type="submit"> </form>'); // Create a new <span> $span = $dom->createElement('span', 'hello'); // Grab the <input elements (we dont have an ID) $inputs = $dom->getElementsByTagName('input'); // Add the <span> between the inputs $inputs->item(0)->parentNode->insertBefore($span, $inputs->item(1)); // By default when you loadHTML(), it generates doctype, html, head, and body tags. remove them! $dom->removeChild($dom->doctype); $dom->replaceChild($dom->firstChild->firstChild->firstChild, $dom->firstChild); // Finally get the HTML $html = $dom->saveHTML(); // And output / return / whatever echo $html;

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.00619.75
8.5.00.0130.00820.08
8.4.160.0130.01023.98
8.4.150.0010.00114.05
8.4.140.0130.01017.86
8.4.130.0100.01217.90
8.4.120.0140.00620.98
8.4.110.0100.01122.52
8.4.100.0110.01118.98
8.4.90.0040.00419.11
8.4.80.0140.00718.82
8.4.70.0070.00218.03
8.4.60.0120.00819.12
8.4.50.0130.00721.84
8.4.40.0160.00322.41
8.4.30.0100.01019.31
8.4.20.0090.00619.03
8.4.10.0060.00617.75
8.3.280.0110.01018.54
8.3.270.0130.00616.97
8.3.260.0110.00816.79
8.3.250.0100.00819.46
8.3.240.0100.00916.87
8.3.230.0090.00216.67
8.3.220.0090.01019.26
8.3.210.0070.01016.98
8.3.200.0030.00616.61
8.3.190.0120.00619.03
8.3.180.0130.00616.86
8.3.170.0070.01116.77
8.3.160.0100.01316.83
8.3.150.0040.00417.28
8.3.140.0150.00316.82
8.3.130.0040.00418.90
8.3.120.0000.00921.03
8.3.110.0030.00620.94
8.3.100.0050.00524.06
8.3.90.0090.00026.77
8.3.80.0080.00418.56
8.3.70.0150.00416.61
8.3.60.0040.01416.88
8.3.50.0050.01322.05
8.3.40.0040.01118.68
8.3.30.0100.00618.60
8.3.20.0050.00320.56
8.3.10.0080.00020.65
8.3.00.0080.00023.73
8.2.290.0120.00620.75
8.2.280.0050.00418.91
8.2.270.0170.00317.04
8.2.260.0090.00619.23
8.2.250.0030.00616.78
8.2.240.0090.00017.29
8.2.230.0030.00722.58
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0050.00517.13
8.2.190.0040.01116.88
8.2.180.0120.00618.43
8.2.170.0110.00422.96
8.2.160.0100.00320.49
8.2.150.0080.00024.18
8.2.140.0000.00724.66
8.2.130.0050.00322.46
8.2.120.0000.00726.35
8.2.110.0080.00419.42
8.2.100.0040.00818.16
8.2.90.0000.00819.47
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0080.00417.91
8.2.50.0040.00419.38
8.2.40.0000.00820.62
8.2.30.0000.00720.64
8.2.20.0070.00018.36
8.2.10.0000.00718.32
8.2.00.0000.00818.36
8.1.330.0110.00822.41
8.1.320.0040.00416.66
8.1.310.0090.00018.91
8.1.300.0060.00317.01
8.1.290.0090.00030.84
8.1.280.0090.01225.92
8.1.270.0060.00320.96
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0070.00324.08
8.1.230.0040.00819.25
8.1.220.0040.00418.03
8.1.210.0000.00818.77
8.1.200.0030.00717.48
8.1.190.0030.00517.38
8.1.180.0040.00418.10
8.1.170.0050.00518.79
8.1.160.0040.00419.10
8.1.150.0070.00020.59
8.1.140.0040.00419.86
8.1.130.0000.00719.21
8.1.120.0050.00317.66
8.1.110.0110.00017.59
8.1.100.0050.00317.65
8.1.90.0040.00417.61
8.1.80.0020.00517.65
8.1.70.0000.00717.60
8.1.60.0070.00017.77
8.1.50.0040.00417.69
8.1.40.0000.00817.69
8.1.30.0000.00817.74
8.1.20.0080.00017.80
8.1.10.0070.00017.70
8.1.00.0000.00817.75
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0000.00818.68
8.0.270.0040.00417.46
8.0.260.0000.00717.57
8.0.250.0080.00017.18
8.0.240.0030.00717.12
8.0.230.0000.00717.20
8.0.220.0050.00317.04
8.0.210.0030.00316.99
8.0.200.0070.00017.17
8.0.190.0060.00317.08
8.0.180.0050.00216.96
8.0.170.0050.00217.15
8.0.160.0040.00417.04
8.0.150.0050.00316.95
8.0.140.0050.00217.03
8.0.130.0000.00613.50
8.0.120.0080.00017.11
8.0.110.0040.00416.77
8.0.100.0000.00816.93
8.0.90.0040.00416.77
8.0.80.0110.00816.91
8.0.70.0050.00217.05
8.0.60.0040.00416.96
8.0.50.0000.00816.80
8.0.30.0130.00817.34
8.0.20.0130.00817.50
8.0.10.0050.00216.99
8.0.00.0140.00616.76
7.4.330.0030.00315.55
7.4.320.0000.00716.86
7.4.300.0060.00016.82
7.4.290.0000.00716.75
7.4.280.0080.00016.75
7.4.270.0000.00716.77
7.4.260.0000.00816.72
7.4.250.0000.00716.66
7.4.240.0040.00416.86
7.4.230.0000.00716.70
7.4.220.0170.00716.96
7.4.210.0030.01316.93
7.4.200.0070.00016.89
7.4.160.0070.00916.63
7.4.150.0090.00917.40
7.4.140.0080.01117.86
7.4.130.0100.00916.81
7.4.120.0120.01016.71
7.4.110.0190.00316.80
7.4.100.0180.00616.72
7.4.90.0130.00916.57
7.4.80.0140.00719.39
7.4.70.0100.00716.57
7.4.60.0150.00316.49
7.4.50.0100.00716.50
7.4.40.0040.01216.73
7.4.30.0060.01216.82
7.4.00.0000.01215.14
7.3.330.0000.00513.38
7.3.320.0030.00313.39
7.3.310.0070.00016.66
7.3.300.0060.00316.45
7.3.290.0090.00516.58
7.3.280.0080.00816.53
7.3.270.0070.01017.40
7.3.260.0090.01116.61
7.3.250.0100.00916.64
7.3.240.0110.00816.70
7.3.230.0120.00616.76
7.3.210.0080.00816.83
7.3.200.0100.00616.66
7.3.190.0120.00416.66
7.3.180.0090.00816.63
7.3.170.0140.00916.84
7.3.160.0100.00616.51
7.2.330.0060.01217.10
7.2.320.0100.00917.09
7.2.310.0080.01016.70
7.2.300.0070.01016.84
7.2.290.0110.00716.70
7.2.60.0000.01516.87
7.2.50.0140.00717.07
7.1.200.0030.00715.99
7.1.70.0080.00417.32
7.1.60.0140.01117.03
7.1.50.0080.00817.02
7.1.40.0040.00717.00
7.1.30.0000.01117.00
7.1.20.0040.01817.00
7.1.10.0030.00617.00
7.1.00.0040.01117.00
7.0.200.0130.00517.00
7.0.190.0050.00717.00
7.0.180.0030.00617.00
7.0.170.0000.00717.00
7.0.160.0040.00817.00
7.0.150.0000.01017.00
7.0.140.0030.00617.00
7.0.130.0000.00917.00
7.0.120.0040.00417.00
7.0.110.0050.00517.00
7.0.100.0090.00917.00
7.0.90.0040.00817.00
7.0.80.0000.01117.00
7.0.70.0080.00817.00
7.0.60.0050.00517.00
7.0.50.0080.00817.00
7.0.40.0000.01117.00
7.0.30.0040.00717.00
7.0.20.0070.01017.00
7.0.10.0000.00717.00
7.0.00.0000.01117.00

preferences:
41.79 ms | 403 KiB | 5 Q