3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DomDocument('1.0', 'UTF-8'); $doc->formatOutput = true; $iterator = new ArrayIterator([ ['john', 'doe', 'john.doe@example.com'], ['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 '<pre>', htmlspecialchars($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.0070.01516.75
8.3.50.0180.00418.33
8.3.40.0100.01019.06
8.3.30.0060.00919.41
8.3.20.0080.00020.41
8.3.10.0040.00422.02
8.3.00.0050.00319.51
8.2.180.0110.00718.27
8.2.170.0120.00322.96
8.2.160.0070.01022.16
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00020.02
8.2.110.0090.00019.43
8.2.100.0060.00617.84
8.2.90.0040.00417.75
8.2.80.0060.00618.16
8.2.70.0040.00418.03
8.2.60.0090.00018.05
8.2.50.0040.00419.90
8.2.40.0070.00020.70
8.2.30.0070.00018.13
8.2.20.0040.00417.87
8.2.10.0040.00418.27
8.2.00.0030.00617.89
8.1.280.0130.00725.92
8.1.270.0060.00320.78
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.59
8.1.230.0090.00322.95
8.1.220.0040.00417.91
8.1.210.0000.00818.77
8.1.200.0050.00317.48
8.1.190.0040.00417.47
8.1.180.0000.00818.10
8.1.170.0030.00518.78
8.1.160.0000.00722.22
8.1.150.0000.00719.04
8.1.140.0040.00417.63
8.1.130.0030.00618.01
8.1.120.0060.00317.67
8.1.110.0040.00417.70
8.1.100.0030.00517.62
8.1.90.0040.00417.64
8.1.80.0000.00717.59
8.1.70.0030.00317.55
8.1.60.0030.00617.78
8.1.50.0040.00417.75
8.1.40.0050.00317.76
8.1.30.0000.00817.76
8.1.20.0040.00417.77
8.1.10.0040.00417.77
8.1.00.0070.00017.61
8.0.300.0040.00419.91
8.0.290.0060.00316.88
8.0.280.0000.00718.74
8.0.270.0030.00317.46
8.0.260.0000.00617.33
8.0.250.0040.00417.16
8.0.240.0030.00317.11
8.0.230.0030.00517.06
8.0.220.0030.00517.02
8.0.210.0000.00717.01
8.0.200.0070.00317.13
8.0.190.0040.00417.07
8.0.180.0060.00317.04
8.0.170.0040.00417.02
8.0.160.0060.00317.01
8.0.150.0050.00317.01
8.0.140.0040.00416.94
8.0.130.0000.00613.55
8.0.120.0000.00817.02
8.0.110.0000.00716.98
8.0.100.0070.00017.08
8.0.90.0030.00517.11
8.0.80.0060.01017.11
8.0.70.0030.00517.02
8.0.60.0000.00917.11
8.0.50.0080.00016.98
8.0.30.0130.01117.35
8.0.20.0090.01017.55
8.0.10.0070.00017.25
8.0.00.0080.01016.84
7.4.330.0050.00015.18
7.4.320.0030.00316.67
7.4.300.0030.00316.73
7.4.290.0000.01016.75
7.4.280.0020.00516.73
7.4.270.0000.00716.85
7.4.260.0040.00416.55
7.4.250.0040.00416.69
7.4.240.0050.00216.70
7.4.230.0050.00316.78
7.4.220.0130.01316.64
7.4.210.0110.00616.70
7.4.200.0000.00716.89
7.4.160.0060.00916.61
7.4.150.0120.00617.40
7.4.140.0140.00417.86
7.4.130.0120.00616.89
7.4.120.0100.00716.80
7.4.110.0100.01016.45
7.4.100.0050.01116.63
7.4.90.0090.00916.47
7.4.80.0150.00319.39
7.4.70.0070.01016.73
7.4.60.0080.00816.80
7.4.50.0000.00816.75
7.4.40.0120.00916.73
7.4.30.0150.00616.64
7.4.00.0070.01015.00
7.3.330.0000.00513.52
7.3.320.0110.00413.39
7.3.310.0030.00316.63
7.3.300.0020.00516.48
7.3.290.0000.00716.49
7.3.280.0100.00716.53
7.3.270.0120.00617.40
7.3.260.0110.00716.81
7.3.250.0100.01116.68
7.3.240.0170.00016.78
7.3.230.0120.00916.49
7.3.210.0040.01216.54
7.3.200.0160.00019.39
7.3.190.0040.01116.70
7.3.180.0040.01116.47
7.3.170.0070.01416.48
7.3.160.0100.01316.90
7.3.120.0130.00615.26
7.3.110.0090.00614.89
7.3.100.0050.00515.19
7.3.90.0080.00515.10
7.3.80.0040.00814.89
7.3.70.0030.01215.12
7.3.60.0120.00315.10
7.3.50.0040.01114.92
7.3.40.0110.00014.96
7.3.30.0030.01014.87
7.3.20.0060.00616.89
7.3.10.0020.01316.85
7.3.00.0070.00516.88
7.2.330.0140.00316.80
7.2.320.0070.00916.93
7.2.310.0030.01416.70
7.2.300.0160.01016.96
7.2.290.0040.01317.00
7.2.250.0040.01414.95
7.2.240.0130.00615.54
7.2.230.0060.00314.82
7.2.220.0080.00815.00
7.2.210.0030.00615.11
7.2.200.0030.00615.18
7.2.190.0060.00915.13
7.2.180.0060.00915.16
7.2.170.0050.00515.09
7.2.130.0150.00017.29
7.2.120.0100.00617.17
7.2.110.0030.01316.80
7.2.100.0110.00417.14
7.2.90.0100.00717.05
7.2.80.0070.01116.79
7.2.70.0040.01216.86
7.2.60.0030.00716.98
7.2.50.0130.00317.20
7.2.40.0070.01016.81
7.2.30.0000.01516.92
7.2.20.0060.00816.97
7.2.10.0040.00717.16
7.2.00.0040.01018.36
7.1.330.0070.00715.94
7.1.320.0030.01015.87
7.1.310.0110.00416.27
7.1.300.0040.01115.66
7.1.290.0080.00415.87
7.1.280.0070.00716.02
7.1.270.0040.00416.08
7.1.260.0040.01115.92
7.1.250.0090.00616.05
7.1.100.0040.00818.08
7.1.70.0090.00317.41
7.1.60.0100.01019.46
7.1.50.0070.01416.89
7.1.00.0070.07322.52
7.0.200.0130.01016.73
7.0.140.0000.07722.08
7.0.60.0030.08319.98
7.0.50.0070.08318.07
7.0.40.0100.03720.33
7.0.30.0300.04720.15
7.0.20.0230.05320.16
7.0.10.0200.06320.30
7.0.00.0030.04320.29
5.6.280.0130.06720.82
5.6.210.0000.05020.71
5.6.200.0070.07718.40
5.6.190.0070.08020.57
5.6.180.0270.07320.46
5.6.170.0270.08020.64
5.6.160.0070.04320.63
5.6.150.0100.03318.30
5.6.140.0030.04018.27
5.6.130.0100.03718.37
5.6.120.0100.04020.94
5.6.110.0100.08721.16
5.6.100.0030.04021.02
5.6.90.0000.09021.02
5.6.80.0070.08020.58
5.6.70.0070.04020.49
5.5.350.0100.08020.35
5.5.340.0070.04018.09
5.5.330.0000.04720.54
5.5.320.0000.08320.51
5.5.310.0270.06320.30
5.5.300.0000.07018.04
5.5.290.0130.07718.04
5.5.280.0030.08020.83
5.5.270.0070.05020.80
5.5.260.0200.07020.81
5.5.250.0130.05720.73
5.5.240.0030.05320.41
5.4.450.0700.06019.56
5.4.440.1100.06719.33
5.4.430.1030.05719.65
5.4.420.1270.05319.65
5.4.410.0670.06719.55
5.4.400.0100.06018.90
5.4.390.0170.05318.85
5.4.380.0070.06318.79
5.4.370.0230.06018.88
5.4.360.0200.05318.77
5.4.350.0230.05018.80
5.4.340.0170.06018.91
5.4.320.0230.05318.77
5.4.310.0070.06718.90
5.4.300.0200.06318.56
5.4.290.0100.06018.67
5.4.280.0230.04718.56
5.4.270.0170.05718.80
5.4.260.0230.04718.51
5.4.250.0300.05018.64
5.4.240.0170.05318.46
5.4.230.0200.04718.55
5.4.220.0130.05718.68
5.4.210.0130.05318.88
5.4.200.0070.06016.69
5.4.190.0230.04718.82
5.4.180.0370.03718.90
5.4.170.0230.06018.55
5.4.160.0170.05718.63
5.4.150.0300.05318.83
5.4.140.0200.05016.37
5.4.130.0130.05016.38
5.4.120.0130.05316.41
5.4.110.0130.05016.30
5.4.100.0200.04716.21
5.4.90.0130.05316.29
5.4.80.0130.05316.52
5.4.70.0100.06016.31
5.4.60.0200.04316.23
5.4.50.0130.05716.38
5.4.40.0170.05316.34
5.4.30.0230.04716.21
5.4.20.0170.05316.46
5.4.10.0200.05316.48
5.4.00.0200.05015.97
5.3.290.0230.05314.62
5.3.280.0230.05314.52
5.3.270.0170.06714.61
5.3.260.0200.05314.60
5.3.250.0170.05314.70
5.3.240.0200.04714.50
5.3.230.0130.05714.58
5.3.220.0130.06014.47
5.3.210.0230.05014.48
5.3.200.0170.05014.66
5.3.190.0070.06014.54
5.3.180.0070.06014.64
5.3.170.0070.05714.59
5.3.160.0200.04714.61
5.3.150.0170.05314.54
5.3.140.0230.04714.54
5.3.130.0170.07314.52
5.3.120.0070.06314.54
5.3.110.0230.05014.54
5.3.100.0170.05014.02
5.3.90.0130.06313.93
5.3.80.0130.05014.01
5.3.70.0200.04713.92
5.3.60.0170.05013.93
5.3.50.0230.04013.93
5.3.40.0170.05313.86
5.3.30.0100.05313.89
5.3.20.0170.05013.60
5.3.10.0300.03313.63
5.3.00.0130.05013.56
5.2.170.0130.04711.12
5.2.160.0170.04011.13
5.2.150.0230.04711.20
5.2.140.0230.04311.28
5.2.130.0170.05011.07
5.2.120.0170.04311.09
5.2.110.0130.03711.14
5.2.100.0230.03311.08
5.2.90.0130.04011.15
5.2.80.0230.03711.13
5.2.70.0170.03711.25
5.2.60.0130.04311.03
5.2.50.0130.04010.98
5.2.40.0100.04011.05
5.2.30.0170.04311.00
5.2.20.0130.03710.93
5.2.10.0170.03310.84
5.2.00.0170.03310.81
5.1.60.0100.03710.03
5.1.50.0130.03010.00
5.1.40.0130.03010.06
5.1.30.0230.03310.39
5.1.20.0000.04710.51
5.1.10.0000.04310.11
5.1.00.0100.04310.14
5.0.50.0130.0238.61
5.0.40.0030.0338.55
5.0.30.0100.0408.25
5.0.20.0070.0278.23
5.0.10.0000.0338.15
5.0.00.0070.0438.28
4.4.90.0100.0205.88
4.4.80.0030.0235.88
4.4.70.0030.0235.85
4.4.60.0030.0235.90
4.4.50.0030.0275.90
4.4.40.0030.0375.86
4.4.30.0100.0205.87
4.4.20.0000.0275.94
4.4.10.0100.0205.96
4.4.00.0030.0375.94
4.3.110.0030.0235.82
4.3.100.0100.0175.86
4.3.90.0070.0205.88
4.3.80.0130.0275.86
4.3.70.0070.0205.88
4.3.60.0130.0235.84
4.3.50.0100.0275.82
4.3.40.0100.0305.84
4.3.30.0030.0234.63
4.3.20.0030.0234.58
4.3.10.0070.0204.51
4.3.00.0130.0278.77

preferences:
42.78 ms | 400 KiB | 5 Q