3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DomDocument('1.0', 'UTF-8'); $doc->formatOutput = true; $iterator = new ArrayIterator(array( array('john', 'doe', 'john.doe@example.com'), array('jane', 'doe', 'jane.doe@example.com'), )); $root = $doc->createElement('table'); foreach ($iterator as $row) { $item = $doc->createElement('tr'); array_walk($row, function ($value) use (&$item, $doc) { $content = $doc->createTextNode($value); $cell = $doc->createElement('td'); $cell->appendChild($content); $item->appendChild($cell); }); $root->appendChild($item); } $doc->appendChild($root); $doc->documentElement->setAttribute('class', 'foo'); echo $doc->saveHTML($doc->documentElement);

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.00616.73
8.3.50.0100.01418.31
8.3.40.0070.00719.05
8.3.30.0100.00319.30
8.3.20.0060.00320.41
8.3.10.0000.00822.16
8.3.00.0000.00819.63
8.2.180.0130.01018.32
8.2.170.0090.00622.96
8.2.160.0100.00322.27
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.55
8.2.110.0060.00319.56
8.2.100.0130.00017.75
8.2.90.0000.00819.07
8.2.80.0040.00417.97
8.2.70.0040.00417.88
8.2.60.0040.00418.16
8.2.50.0000.00818.07
8.2.40.0000.00819.88
8.2.30.0000.00718.14
8.2.20.0060.00317.91
8.2.10.0000.00718.35
8.2.00.0000.00817.81
8.1.280.0160.00625.92
8.1.270.0080.00020.76
8.1.260.0070.00026.35
8.1.250.0050.00328.09
8.1.240.0030.00624.23
8.1.230.0090.00317.48
8.1.220.0050.00317.77
8.1.210.0040.00418.77
8.1.200.0030.00617.60
8.1.190.0050.00317.61
8.1.180.0040.00418.10
8.1.170.0030.00620.50
8.1.160.0040.00422.24
8.1.150.0040.00419.11
8.1.140.0060.00317.62
8.1.130.0000.00718.07
8.1.120.0100.00017.67
8.1.110.0040.00417.64
8.1.100.0040.00317.69
8.1.90.0030.00517.55
8.1.80.0040.00417.63
8.1.70.0070.00017.63
8.1.60.0090.00017.62
8.1.50.0040.00417.59
8.1.40.0040.00417.70
8.1.30.0040.00417.89
8.1.20.0000.00717.83
8.1.10.0000.00817.73
8.1.00.0000.00817.70
8.0.300.0040.00418.77
8.0.290.0040.00816.58
8.0.280.0030.00318.57
8.0.270.0020.00517.46
8.0.260.0030.00317.36
8.0.250.0000.00717.11
8.0.240.0030.00617.13
8.0.230.0070.00017.00
8.0.220.0030.00317.06
8.0.210.0040.00416.97
8.0.200.0070.00317.15
8.0.190.0000.00717.04
8.0.180.0000.00716.98
8.0.170.0000.00917.08
8.0.160.0030.00517.09
8.0.150.0000.00716.96
8.0.140.0030.00617.09
8.0.130.0000.00613.56
8.0.120.0000.00816.97
8.0.110.0080.00017.08
8.0.100.0070.00017.06
8.0.90.0040.00417.04
8.0.80.0110.00616.99
8.0.70.0040.00417.12
8.0.60.0030.00516.97
8.0.50.0040.00417.10
8.0.30.0090.01417.33
8.0.20.0140.00917.40
8.0.10.0000.00717.13
8.0.00.0110.00616.97
7.4.330.0030.00315.28
7.4.320.0000.00616.62
7.4.300.0000.00616.68
7.4.290.0030.00716.84
7.4.280.0040.00416.57
7.4.270.0000.00816.75
7.4.260.0040.00416.63
7.4.250.0000.00716.81
7.4.240.0020.00516.71
7.4.230.0030.00316.43
7.4.220.0160.00316.59
7.4.210.0020.01316.83
7.4.200.0040.00416.77
7.4.160.0090.00916.52
7.4.150.0120.00617.40
7.4.140.0070.01017.86
7.4.130.0140.00416.75
7.4.120.0100.00716.63
7.4.110.0180.00616.66
7.4.100.0120.00816.65
7.4.90.0070.01116.86
7.4.80.0120.00819.39
7.4.70.0060.01016.46
7.4.60.0040.01216.77
7.4.50.0040.00416.50
7.4.40.0100.00616.39
7.4.30.0090.01316.73
7.4.00.0070.01014.91
7.3.330.0050.00013.46
7.3.320.0060.00613.46
7.3.310.0040.00416.55
7.3.300.0000.00616.60
7.3.290.0000.00716.46
7.3.280.0100.00816.47
7.3.270.0090.00917.40
7.3.260.0140.00416.66
7.3.250.0070.01216.82
7.3.240.0070.01016.59
7.3.230.0170.00716.51
7.3.210.0070.01016.49
7.3.200.0030.01319.39
7.3.190.0120.00416.78
7.3.180.0060.01216.70
7.3.170.0180.00616.84
7.3.160.0120.00616.59
7.3.10.0030.01316.70
7.3.00.0100.00316.79
7.2.330.0110.00716.68
7.2.320.0110.01116.93
7.2.310.0130.00817.04
7.2.300.0100.00716.62
7.2.290.0100.00716.80
7.2.130.0000.01617.08
7.2.120.0030.01316.93
7.2.110.0090.00616.87
7.2.100.0140.00016.85
7.2.90.0110.00616.74
7.2.80.0080.00416.79
7.2.70.0040.01116.77
7.2.60.0060.00816.72
7.2.50.0090.00617.02
7.2.40.0030.00717.20
7.2.30.0030.01316.88
7.2.20.0070.01016.91
7.2.10.0030.00716.74
7.2.00.0080.00618.09
7.1.250.0040.00716.05
7.1.200.0080.00415.83
7.1.100.0140.00717.99
7.1.70.0000.00817.39
7.1.60.0140.01019.46
7.1.50.0040.01816.97
7.1.00.0000.08022.38
7.0.200.0690.00614.96
7.0.140.0000.05722.05
7.0.60.0200.07020.05
7.0.50.0030.06317.91
7.0.40.0070.07320.36
7.0.30.0170.04020.33
7.0.20.0270.05020.25
7.0.10.0270.07320.25
7.0.00.0030.08720.16
5.6.280.0030.07321.16
5.6.210.0070.03720.58
5.6.200.0030.08718.29
5.6.190.0030.07020.74
5.6.180.0100.05720.75
5.6.170.0270.07720.57
5.6.160.0030.05320.57
5.6.150.0030.04018.29
5.6.140.0000.04318.24
5.6.130.0130.06318.35
5.6.120.0030.06021.16
5.6.110.0070.08321.12
5.6.100.0000.04721.05
5.6.90.0070.07321.09
5.6.80.0230.06320.33
5.6.70.0130.07320.34
5.5.350.0070.08720.39
5.5.340.0070.05718.08
5.5.330.0030.04020.42
5.5.320.0070.08020.39
5.5.310.0270.09020.57
5.5.300.0070.08018.04
5.5.290.0070.03718.05
5.5.280.0070.08020.82
5.5.270.0100.03320.98
5.5.260.0000.04320.83
5.5.250.0030.08720.66
5.5.240.0070.08720.31
5.4.450.0500.05719.38
5.4.440.0100.06719.38
5.4.430.0770.04319.70
5.4.420.0530.05719.33
5.4.410.0270.04319.41
5.4.400.0130.05718.90
5.4.390.0230.07018.79
5.4.380.0230.07318.59
5.4.370.0270.05018.64
5.4.360.0100.06018.65
5.4.350.0330.05018.77
5.4.340.0170.05718.86
5.4.320.0300.05018.79
5.4.310.0230.05318.66
5.4.300.0170.06018.56
5.4.290.0200.04718.88
5.4.280.0200.06318.78
5.4.270.0130.06318.52
5.4.260.0130.06318.84
5.4.250.0230.04718.66
5.4.240.0230.05318.53
5.4.230.0100.05718.75
5.4.220.0100.06018.51
5.4.210.0300.04018.86
5.4.200.0170.05016.69
5.4.190.0130.06018.75
5.4.180.0100.07318.84
5.4.170.0170.05318.51
5.4.160.0200.05718.82
5.4.150.0300.04718.77
5.4.140.0130.06716.30
5.4.130.0200.04716.35
5.4.120.0130.05316.36
5.4.110.0200.04316.24
5.4.100.0130.06016.26
5.4.90.0170.05016.45
5.4.80.0100.05716.30
5.4.70.0230.04716.18
5.4.60.0270.04716.37
5.4.50.0170.05016.37
5.4.40.0130.05716.32
5.4.30.0170.05716.20
5.4.20.0230.05016.48
5.4.10.0170.05716.33
5.4.00.0100.06015.84
5.3.290.0100.07014.95
5.3.280.0230.04714.77
5.3.270.0200.05014.80
5.3.260.0130.06014.72
5.3.250.0200.05014.79
5.3.240.0200.05014.85
5.3.230.0170.05714.80
5.3.220.0200.05014.84
5.3.210.0070.06714.75
5.3.200.0330.04314.74
5.3.190.0200.05014.93
5.3.180.0230.06314.85
5.3.170.0170.06014.70
5.3.160.0230.05014.64
5.3.150.0200.05014.83
5.3.140.0130.05714.69
5.3.130.0230.06314.76
5.3.120.0130.06014.80
5.3.110.0170.07014.75
5.3.100.0100.06714.21
5.3.90.0170.05714.20
5.3.80.0300.05714.12
5.3.70.0200.05314.14
5.3.60.0170.05014.11
5.3.50.0330.03714.18
5.3.40.0230.06014.05
5.3.30.0270.04314.02
5.3.20.0170.05313.80
5.3.10.0230.06013.89
5.3.00.0230.05713.64
5.2.170.0070.05011.15
5.2.160.0200.04711.10
5.2.150.0170.04711.10
5.2.140.0170.04711.18
5.2.130.0270.04711.26
5.2.120.0170.05011.13
5.2.110.0130.04011.26
5.2.100.0170.04011.07
5.2.90.0130.04311.07
5.2.80.0070.05311.11
5.2.70.0130.04311.14
5.2.60.0130.04711.09
5.2.50.0070.06311.17
5.2.40.0130.04311.03
5.2.30.0100.04310.94
5.2.20.0200.05310.98
5.2.10.0100.04310.84
5.2.00.0200.03310.73
5.1.60.0170.03010.02
5.1.50.0100.04710.12
5.1.40.0130.03310.14
5.1.30.0130.03310.45
5.1.20.0100.03710.43
5.1.10.0100.03710.13
5.1.00.0170.03310.18
5.0.50.0030.0338.59
5.0.40.0030.0308.41
5.0.30.0030.0478.26
5.0.20.0100.0308.31
5.0.10.0170.0308.21
5.0.00.0100.0408.35
4.4.90.0100.0275.87
4.4.80.0070.0305.93
4.4.70.0130.0235.89
4.4.60.0130.0205.89
4.4.50.0030.0275.89
4.4.40.0030.0435.90
4.4.30.0130.0205.89
4.4.20.0000.0375.97
4.4.10.0000.0375.93
4.4.00.0030.0435.98
4.3.110.0070.0305.84
4.3.100.0070.0305.84
4.3.90.0170.0175.83
4.3.80.0130.0375.83
4.3.70.0070.0275.84
4.3.60.0070.0305.79
4.3.50.0100.0205.82
4.3.40.0130.0305.82
4.3.30.0030.0234.58
4.3.20.0000.0274.54
4.3.10.0070.0204.53
4.3.00.0100.0208.77

preferences:
38.57 ms | 400 KiB | 5 Q