3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument(); $doc->loadXML( <<<XML <container xmlns="http://symfony.com/schema/dic/services"> CHILDREN </container> XML ); // // Remove xmlns Attribute + Validate it is actually gone. // As you can see, it still remembers a 'xmlns' DOMNameSpaceNode with an empty namespaceURI (which basically is invalid!) // $doc->documentElement->removeAttributeNS('http://symfony.com/schema/dic/services', ''); var_dump($doc->documentElement->getAttributeNode('xmlns')); $namespaces = [...(new DOMXPath($doc))->query('./namespace::*', $doc->documentElement)]; // // Yet when saving the XML : there is no problem, the namespaces are gone. // echo $doc->saveXML(); var_dump($namespaces); // // However ... // When importing the node in a new document, it gets prefixed by <default:container ...> without any xmlns:default declaration // $new = new DOMDocument(); $new->append( $new->importNode($doc->documentElement, true) ); echo $new->saveXML(); // Resulting in invalid XML obviously: $previousErrorReporting = libxml_use_internal_errors(true); libxml_clear_errors(); $parsedAgain = new DOMDocument(); $parsedAgain->loadXML($new->saveXML()); $errors = libxml_get_errors(); libxml_clear_errors(); libxml_use_internal_errors($previousErrorReporting); var_dump($errors);

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.4.140.0140.00818.00
8.4.130.0110.00818.27
8.4.120.0050.00421.29
8.4.110.0110.01019.04
8.4.100.0150.00619.39
8.4.90.0160.00422.57
8.4.80.0060.00219.20
8.4.70.0130.00718.32
8.4.60.0040.00519.30
8.4.50.0100.00721.03
8.4.40.0100.01019.38
8.4.30.0130.00619.22
8.4.20.0110.00320.12
8.4.10.0030.00619.96
8.3.270.0080.01317.02
8.3.260.0100.01116.80
8.3.250.0120.00819.08
8.3.240.0030.00616.89
8.3.230.0070.00116.81
8.3.220.0060.00219.49
8.3.210.0090.00918.74
8.3.200.0050.00416.91
8.3.190.0100.00717.39
8.3.180.0100.00916.73
8.3.170.0090.00019.39
8.3.160.0130.00617.86
8.3.150.0070.01017.59
8.3.140.0070.00716.88
8.3.130.0090.00017.01
8.3.120.0060.00319.27
8.3.110.0120.00020.94
8.3.100.0130.00316.67
8.3.90.0070.00726.77
8.3.80.0060.00318.53
8.3.70.0150.00717.00
8.3.60.0280.01423.51
8.3.50.0150.00622.88
8.3.40.0190.00824.81
8.3.30.0160.01023.77
8.3.20.0210.00725.03
8.3.10.0220.00325.09
8.3.00.0180.00724.79
8.2.290.0060.00220.74
8.2.280.0100.01020.27
8.2.270.0030.00617.63
8.2.260.0110.00718.46
8.2.250.0040.01117.07
8.2.240.0060.01017.38
8.2.230.0060.00322.58
8.2.220.0090.00024.06
8.2.210.0080.00026.77
8.2.200.0070.00319.04
8.2.190.0070.01119.04
8.2.180.0230.01025.92
8.2.170.0260.00923.72
8.2.160.0210.00924.13
8.2.150.0190.00724.72
8.2.140.0190.00724.80
8.2.130.0250.00225.17
8.2.120.0190.00723.63
8.2.110.0240.01124.06
8.2.100.0250.00923.72
8.2.90.0230.00923.06
8.2.80.0190.00923.11
8.2.70.0250.00822.87
8.2.60.0220.00622.98
8.2.50.0280.00522.99
8.2.40.0250.00523.03
8.2.30.0240.00722.96
8.2.20.0210.00822.96
8.2.10.0190.01122.97
8.2.00.0180.00823.04
8.1.330.0100.01016.50
8.1.320.0090.00816.44
8.1.310.0090.00618.71
8.1.300.0130.00318.75
8.1.290.0060.00330.84
8.1.280.0320.00925.92
8.1.270.0240.01125.16
8.1.260.0230.00925.64
8.1.250.0200.00726.04
8.1.240.0230.00522.88
8.1.230.0200.00622.87
8.1.220.0220.01022.97
8.1.210.0220.00823.17
8.1.200.0230.00722.91
8.1.190.0240.00622.87
8.1.180.0200.00922.84
8.1.170.0210.00822.91
8.1.160.0230.00623.01
8.1.150.0210.00923.41
8.1.140.0220.00722.89
8.1.130.0250.00322.90
8.1.120.0200.01122.84
8.1.110.0220.00822.95
8.1.100.0200.00923.27
8.1.90.0230.00522.87
8.1.80.0220.00523.21
8.1.70.0240.00322.95
8.1.60.0230.00822.92
8.1.50.0240.01022.83
8.1.40.0270.00523.00
8.1.30.0240.00923.02
8.1.20.0240.00923.19
8.1.10.0210.01122.99
8.1.00.0250.00722.96
8.0.300.0230.00822.51
8.0.290.0250.00922.53
8.0.280.0240.00822.53
8.0.270.0230.00922.55
8.0.260.0240.00722.11
8.0.250.0260.00322.54
8.0.240.0260.00322.19
8.0.230.0200.00822.25
8.0.220.0220.00622.11
8.0.210.0230.00822.44
8.0.200.0240.00822.08
8.0.190.0250.00522.05
8.0.180.0230.00722.56
8.0.170.0260.00722.10
8.0.160.0230.00522.61
8.0.150.0250.00722.53
8.0.140.0280.00322.17
8.0.130.0210.00922.19
8.0.120.0230.01022.03
8.0.110.0260.00822.04
8.0.100.0240.00922.15
8.0.90.0300.00322.06
8.0.80.0260.00922.10
8.0.70.0260.00822.17
8.0.60.0280.00922.04
8.0.50.0250.00822.12
8.0.30.0230.00922.61
8.0.20.0230.00622.61
8.0.10.0240.00822.64

preferences:
30.01 ms | 403 KiB | 5 Q