3v4l.org

run code in 300+ PHP versions simultaneously
<?php $template = <<<XML <?xml version="1.0" encoding="utf-8"?> <resources></resources> XML; $writer = new SimpleXMLElement( $template ); $messages = array( 'key' => 'value', 'anotherkey' => 'anothervalue', ); foreach ( $messages as $key => $value ) { $element = $writer->addChild( 'string', $value ); $element->addAttribute( 'name', $key ); // This is non-standard if ( $key === 'key' ) { $element->addAttribute( 'fuzzy', 'true' ); } } // Make the output pretty with DOMDocument $dom = new DOMDocument( '1.0' ); $dom->formatOutput = false; $dom->preserveWhiteSpace = true; $dom->loadXML( $writer->asXML() ); echo $dom->saveXML();

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.0110.00716.88
8.3.50.0100.01022.22
8.3.40.0110.00319.12
8.3.30.0090.00919.29
8.3.20.0080.00020.59
8.3.10.0030.00522.20
8.3.00.0030.00522.76
8.2.180.0070.00718.66
8.2.170.0070.00722.96
8.2.160.0110.00422.52
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0110.00019.49
8.2.110.0030.00719.38
8.2.100.0060.00617.76
8.2.90.0000.00819.45
8.2.80.0040.00417.97
8.2.70.0000.00817.88
8.2.60.0040.00418.18
8.2.50.0060.00318.07
8.2.40.0030.00619.64
8.2.30.0040.00418.21
8.2.20.0050.00217.92
8.2.10.0040.00418.37
8.2.00.0070.00018.37
8.1.280.0090.00925.92
8.1.270.0030.00520.50
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0030.00624.13
8.1.230.0000.01019.26
8.1.220.0000.00818.03
8.1.210.0000.00818.77
8.1.200.0070.00317.60
8.1.190.0040.00417.38
8.1.180.0090.00018.10
8.1.170.0000.00818.89
8.1.160.0000.00822.30
8.1.150.0090.00019.15
8.1.140.0080.00017.69
8.1.130.0000.00717.94
8.1.120.0070.00417.79
8.1.110.0000.00817.64
8.1.100.0040.00417.80
8.1.90.0050.00217.71
8.1.80.0050.00317.75
8.1.70.0080.00017.73
8.1.60.0030.00617.70
8.1.50.0040.00417.80
8.1.40.0060.00317.77
8.1.30.0050.00317.93
8.1.20.0030.00617.81
8.1.10.0000.00817.83
8.1.00.0040.00417.84
8.0.300.0050.00218.77
8.0.290.0040.00417.00
8.0.280.0040.00418.75
8.0.270.0030.00317.51
8.0.260.0070.00317.48
8.0.250.0070.00017.32
8.0.240.0000.00817.37
8.0.230.0000.00717.36
8.0.220.0050.00317.10
8.0.210.0050.00317.25
8.0.200.0070.00317.11
8.0.190.0060.00317.33
8.0.180.0000.00817.24
8.0.170.0040.00417.30
8.0.160.0030.00317.27
8.0.150.0000.00717.24
8.0.140.0040.00417.01
8.0.130.0060.00013.59
8.0.120.0000.00817.27
8.0.110.0040.00417.26
8.0.100.0080.00017.25
8.0.90.0030.00417.16
8.0.80.0150.00417.07
8.0.70.0030.00617.31
8.0.60.0050.00317.04
8.0.50.0030.00517.27
8.0.30.0060.01117.54
8.0.20.0080.01017.40
8.0.10.0000.00817.23
8.0.00.0100.00916.97
7.4.330.0000.00515.33
7.4.320.0030.00316.81
7.4.300.0040.00416.79
7.4.290.0030.00316.95
7.4.280.0040.00416.87
7.4.270.0000.00816.86
7.4.260.0040.00416.71
7.4.250.0040.00416.73
7.4.240.0030.00516.86
7.4.230.0000.00716.89
7.4.220.0170.00316.90
7.4.210.0090.00516.80
7.4.200.0070.00016.66
7.4.160.0190.00316.62
7.4.150.0030.01417.40
7.4.140.0100.01317.86
7.4.130.0030.01416.84
7.4.120.0070.01416.84
7.4.110.0050.01416.86
7.4.100.0100.01316.61
7.4.90.0070.01016.80
7.4.80.0070.01019.39
7.4.70.0090.00616.80
7.4.60.0100.00716.64
7.4.50.0030.00716.95
7.4.40.0030.01616.74
7.4.30.0030.01616.61
7.4.00.0080.00915.21
7.3.330.0000.00613.53
7.3.320.0030.00213.47
7.3.310.0000.00616.48
7.3.300.0000.00616.48
7.3.290.0080.00616.58
7.3.280.0090.00916.70
7.3.270.0030.01317.40
7.3.260.0060.01216.97
7.3.250.0120.00516.76
7.3.240.0130.00716.57
7.3.230.0120.00316.76
7.3.210.0060.01116.68
7.3.200.0030.01419.39
7.3.190.0120.00916.66
7.3.180.0040.01416.62
7.3.170.0110.01216.77
7.3.160.0100.00616.66
7.3.120.0080.00814.90
7.3.110.0030.01014.78
7.3.100.0140.00314.85
7.3.90.0090.00914.98
7.3.80.0080.00414.96
7.3.70.0090.00614.93
7.3.60.0090.00614.97
7.3.50.0060.00914.95
7.3.40.0100.00614.96
7.3.30.0050.00515.02
7.3.20.0030.01317.00
7.3.10.0040.01117.01
7.3.00.0100.00316.68
7.2.330.0150.00317.09
7.2.320.0120.01217.12
7.2.310.0060.01017.00
7.2.300.0090.00616.87
7.2.290.0130.00617.00
7.2.250.0130.00615.28
7.2.240.0060.01215.27
7.2.230.0000.01715.18
7.2.220.0060.00915.19
7.2.210.0030.01015.34
7.2.200.0060.00915.22
7.2.190.0040.00715.16
7.2.180.0030.01315.09
7.2.170.0040.01115.11
7.2.00.0000.01219.70
7.1.330.0070.00716.03
7.1.320.0050.00815.88
7.1.310.0120.00015.84
7.1.300.0030.00615.95
7.1.290.0040.00415.96
7.1.280.0070.00716.01
7.1.270.0070.00615.78
7.1.260.0000.01515.95
7.1.100.0000.01518.29
7.1.70.0030.00517.16
7.1.60.0120.00619.59
7.1.50.0110.01417.15
7.1.00.0070.07022.45
7.0.200.0000.00817.11
7.0.110.0100.08019.93
7.0.100.0100.08320.07
7.0.90.0200.07320.09
7.0.80.0130.08019.99
7.0.70.0070.06720.00
7.0.60.0070.08019.94
7.0.50.0200.08320.26
7.0.40.0100.08020.32
7.0.30.0070.09020.31
7.0.20.0100.08320.08
7.0.10.0100.08020.28
7.0.00.0130.08020.07
5.6.280.0000.04721.05
5.6.260.0030.08320.68
5.6.250.0030.08720.67
5.6.240.0030.08720.63
5.6.230.0070.07320.91
5.6.220.0070.05720.71
5.6.210.0230.06320.58
5.6.200.0070.08321.36
5.6.190.0070.08321.03
5.6.180.0100.08020.95
5.6.170.0100.07721.11
5.6.160.0200.06021.05
5.6.150.0130.07721.20
5.6.140.0100.07721.27
5.6.130.0030.08021.19
5.6.120.0100.06321.34
5.6.110.0130.05021.02
5.6.100.0100.08721.10
5.6.90.0130.08021.32
5.6.80.0030.08020.57
5.6.70.0070.07720.34
5.6.60.0170.07320.70
5.6.50.0130.07320.57
5.6.40.0100.04720.70
5.6.30.0100.07320.70
5.6.20.0000.05320.50
5.6.10.0130.07020.55
5.6.00.0070.08020.60
5.5.380.0100.08020.42
5.5.370.0100.07720.43
5.5.360.0100.06720.55
5.5.350.0070.07720.60
5.5.340.0130.07720.98
5.5.330.0130.07321.10
5.5.320.0100.04321.08
5.5.310.0100.07720.66
5.5.300.0100.08321.08
5.5.290.0070.08320.74
5.5.280.0030.09021.01
5.5.270.0100.08320.98
5.5.260.0100.07320.97
5.5.250.0030.08020.78
5.5.240.0100.09020.48
5.5.230.0070.07720.39
5.5.220.0070.06320.36
5.5.210.0100.08020.37
5.5.200.0130.07020.05
5.5.190.0100.07320.26
5.5.180.0130.08020.20
5.5.160.0030.05020.37
5.5.150.0000.08020.19
5.5.140.0130.07320.31
5.5.130.0100.08020.32
5.5.120.0170.07320.33
5.5.110.0130.07020.36
5.5.100.0200.07020.20
5.5.90.0070.08020.23
5.5.80.0100.08020.25
5.5.70.0070.05019.97
5.5.60.0030.08020.21
5.5.50.0130.04320.32
5.5.40.0200.07320.21
5.5.30.0000.06320.20
5.5.20.0130.07020.27
5.5.10.0070.07020.27
5.5.00.0230.06020.29
5.4.450.0100.04719.55
5.4.440.0130.07719.72
5.4.430.0000.08719.52
5.4.420.0030.05019.64
5.4.410.0070.04719.35
5.4.400.0100.07019.10
5.4.390.0030.08019.22
5.4.380.0100.05719.36
5.4.370.0070.08019.22
5.4.360.0000.08319.11
5.4.350.0100.07019.17
5.4.340.0000.05319.39
5.4.320.0030.08019.32
5.4.310.0100.04019.13
5.4.300.0070.07719.18
5.4.290.0030.07719.39
5.4.280.0030.07019.20
5.4.270.0030.08319.18
5.4.260.0100.07719.32
5.4.250.0030.07319.30
5.4.240.0170.07019.30
5.4.230.0200.06319.08
5.4.220.0130.07019.07
5.4.210.0070.05019.10
5.4.200.0030.08319.05
5.4.190.0070.04319.17
5.4.180.0070.07719.14
5.4.170.0030.08019.31
5.4.160.0070.07719.09
5.4.150.0100.07019.33
5.4.140.0030.04716.59
5.4.130.0070.07716.61
5.4.120.0130.06316.50
5.4.110.0130.06316.70
5.4.100.0000.07716.58
5.4.90.0100.07016.69
5.4.80.0030.07016.42
5.4.70.0070.07716.31
5.4.60.0130.03716.39
5.4.50.0070.06716.48
5.4.40.0030.07016.69
5.4.30.0100.06316.38
5.4.20.0130.05716.39
5.4.10.0070.08016.29
5.4.00.0030.04315.71
5.3.290.0030.08014.71
5.3.280.0030.08014.66
5.3.270.0070.07714.66
5.3.260.0070.06714.62
5.3.250.0100.06314.65
5.3.240.0030.07714.78
5.3.230.0030.05714.63
5.3.220.0100.07314.61
5.3.210.0130.05714.75
5.3.200.0100.03714.54
5.3.190.0070.07714.74
5.3.180.0070.07014.70
5.3.170.0100.07014.71
5.3.160.0130.06714.68
5.3.150.0100.06314.59
5.3.140.0100.07314.70
5.3.130.0030.08314.54
5.3.120.0130.08314.52
5.3.110.0030.07314.57
5.3.100.0070.07314.09
5.3.90.0100.07314.12
5.3.80.0130.05714.04
5.3.70.0200.06014.06
5.3.60.0070.07314.14
5.3.50.0070.06714.09
5.3.40.0170.06314.03
5.3.30.0030.08013.98
5.3.20.0000.06013.77
5.3.10.0030.07313.67
5.3.00.0100.06313.71
5.2.170.0100.05313.48
5.2.160.0100.05713.48
5.2.150.0030.06713.48
5.2.140.0100.05313.48
5.2.130.0070.06013.48
5.2.120.0030.06013.48
5.2.110.0000.04013.48
5.2.100.0070.05713.48
5.2.90.0030.06013.48
5.2.80.0070.06013.48
5.2.70.0170.05313.48
5.2.60.0070.06313.48
5.2.50.0030.05713.48
5.2.40.0000.06313.48
5.2.30.0130.06013.48
5.2.20.0070.06013.48
5.2.10.0070.06013.48
5.2.00.0030.04313.48
5.1.60.0070.04313.48
5.1.50.0130.05013.48
5.1.40.0100.04313.48
5.1.30.0030.05313.48
5.1.20.0130.04713.48
5.1.10.0030.05713.48
5.1.00.0000.06013.48
5.0.50.0000.03313.48
5.0.40.0100.03313.48
5.0.30.0030.05313.48
5.0.20.0000.03313.48
5.0.10.0030.04013.48
5.0.00.0100.05313.48
4.4.90.0030.03013.48
4.4.80.0000.03713.48
4.4.70.0030.03313.48
4.4.60.0100.03013.48
4.4.50.0030.03713.48
4.4.40.0000.05713.48
4.4.30.0000.03713.48
4.4.20.0030.03713.48
4.4.10.0030.03313.48
4.4.00.0070.02313.48
4.3.110.0030.03713.48
4.3.100.0100.02713.48
4.3.90.0030.03313.48
4.3.80.0000.05313.48
4.3.70.0030.03313.48
4.3.60.0000.02713.48
4.3.50.0000.03713.48
4.3.40.0030.05313.48
4.3.30.0030.02713.48
4.3.20.0000.03713.48
4.3.10.0030.03313.48
4.3.00.0070.03013.48

preferences:
54.09 ms | 401 KiB | 5 Q