3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <item is-foo="false" is-bar="false"> <item is-bar="true"> <item> <item is-foo="true"> <item /> <item is-foo="true" /> </item> </item> <item is-foo="true" is-bar="true" /> </item> </item> XML; $schema = <<<SCHEMA <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="item"> <xs:complexType> <xs:sequence> <xs:element ref="item" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="is-foo" type="xs:boolean" default="true" use="optional" /> <xs:attribute name="is-bar" type="xs:boolean" default="false" use="optional" /> </xs:complexType> </xs:element> </xs:schema> SCHEMA; $flags = defined('LIBXML_SCHEMA_CREATE') ? LIBXML_SCHEMA_CREATE : 0; $document = new DOMDocument(); $document->loadXML($xml); var_dump($document->schemaValidateSource($schema, LIBXML_SCHEMA_CREATE)); $xpath = new DOMXPath($document); foreach ($xpath->query('//item') as $item) { echo $item->getNodePath() . PHP_EOL . ' is-foo : ' . $item->getAttribute('is-foo') . PHP_EOL . ' is-bar : ' . $item->getAttribute('is-bar') . PHP_EOL; }

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.0100.01019.30
8.3.50.0110.00821.46
8.3.40.0080.00819.47
8.3.30.0000.01520.94
8.3.20.0000.00821.09
8.3.10.0040.00423.03
8.3.00.0060.00323.23
8.2.180.0170.00717.38
8.2.170.0150.00022.96
8.2.160.0140.00022.87
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0000.00826.16
8.2.120.0000.00821.60
8.2.110.0070.00321.65
8.2.100.0040.00818.41
8.2.90.0080.00020.09
8.2.80.0000.00918.38
8.2.70.0110.00018.25
8.2.60.0060.00318.66
8.2.50.0080.00018.38
8.2.40.0050.00318.77
8.2.30.0030.00620.21
8.2.20.0040.00418.44
8.2.10.0040.00418.58
8.2.00.0030.00618.42
8.1.280.0070.00725.92
8.1.270.0000.00823.99
8.1.260.0000.00726.35
8.1.250.0050.00328.09
8.1.240.0110.00422.83
8.1.230.0040.00718.57
8.1.220.0040.00418.41
8.1.210.0050.00318.77
8.1.200.0070.00318.10
8.1.190.0050.00317.98
8.1.180.0060.00318.10
8.1.170.0040.00419.40
8.1.160.0040.00419.46
8.1.150.0000.00819.36
8.1.140.0050.00318.09
8.1.130.0070.00018.27
8.1.120.0090.00018.04
8.1.110.0000.00718.20
8.1.100.0080.00018.18
8.1.90.0000.00718.17
8.1.80.0000.00818.28
8.1.70.0040.00418.22
8.1.60.0070.00318.29
8.1.50.0040.00418.33
8.1.40.0030.00618.29
8.1.30.0000.00818.28
8.1.20.0040.00418.41
8.1.10.0030.00518.15
8.1.00.0000.00918.27
8.0.300.0070.00218.77
8.0.290.0000.00917.50
8.0.280.0070.00019.06
8.0.270.0040.00417.54
8.0.260.0030.00717.58
8.0.250.0000.00717.53
8.0.240.0090.00017.58
8.0.230.0000.00717.59
8.0.220.0030.00517.49
8.0.210.0000.00717.61
8.0.200.0000.00817.79
8.0.190.0040.00417.77
8.0.180.0030.00517.77
8.0.170.0050.00317.70
8.0.160.0000.00717.62
8.0.150.0000.00717.65
8.0.140.0020.00517.59
8.0.130.0000.00614.23
8.0.120.0050.00317.51
8.0.110.0000.00817.72
8.0.100.0000.00817.61
8.0.90.0040.00417.60
8.0.80.0060.00917.71
8.0.70.0030.00617.59
8.0.60.0000.00817.57
8.0.50.0050.00217.41
8.0.30.0120.01017.72
8.0.20.0140.00617.68
8.0.10.0040.00417.87
8.0.00.0060.01217.54
7.4.330.0050.00017.60
7.4.320.0000.00817.09
7.4.300.0060.00017.33
7.4.290.0040.00417.32
7.4.280.0070.00017.10
7.4.270.0040.00417.34
7.4.260.0030.00314.16
7.4.250.0060.00317.09
7.4.240.0000.00717.06
7.4.230.0000.00817.46
7.4.220.0090.01217.40
7.4.210.0040.01317.29
7.4.200.0050.00317.15
7.4.190.0040.00417.28
7.4.160.0030.01317.09
7.4.150.0110.00717.40
7.4.140.0120.00917.86
7.4.130.0130.00517.24
7.4.120.0060.01117.15
7.4.110.0120.00617.30
7.4.100.0180.00617.22
7.4.90.0100.01017.27
7.4.80.0140.01019.39
7.4.70.0070.01117.14
7.4.60.0130.01017.19
7.4.50.0040.00417.23
7.4.40.0080.00322.77
7.4.30.0110.00717.35
7.4.00.0060.00615.41
7.3.330.0030.00313.69
7.3.320.0050.00013.68
7.3.310.0070.00017.06
7.3.300.0000.00716.93
7.3.290.0060.00916.96
7.3.280.0110.00716.93
7.3.270.0150.00617.40
7.3.260.0080.01116.86
7.3.250.0160.00717.31
7.3.240.0130.00617.23
7.3.230.0030.01416.99
7.3.210.0090.01216.95
7.3.200.0120.00619.39
7.3.190.0100.01317.21
7.3.180.0100.00816.95
7.3.170.0140.00616.97
7.3.160.0140.00717.11
7.3.120.0060.00915.08
7.2.330.0060.01317.34
7.2.320.0030.01617.32
7.2.310.0090.00917.39
7.2.300.0210.00317.34
7.2.290.0130.00617.29
7.2.60.0080.00817.38
7.1.200.0070.01016.01
7.1.100.0030.00618.67
7.1.70.0070.00717.24
7.1.60.0120.00619.17
7.1.50.0060.01617.50
7.1.00.0000.04722.89
7.0.200.0050.00316.78
7.0.140.0030.07722.50
7.0.60.0100.04022.15
7.0.50.0130.06318.34
7.0.40.0030.05720.32
7.0.30.0300.07020.59
7.0.20.0330.07720.54
7.0.10.0130.08320.54
7.0.00.0070.04020.51
5.6.210.0030.09021.00
5.6.200.0030.08718.54
5.6.190.0030.08020.82
5.6.180.0470.05721.01
5.6.170.0230.07020.87
5.6.160.0030.08720.92
5.6.150.0000.05018.52
5.6.140.0100.08018.62
5.6.130.0070.07018.61
5.6.120.0030.08321.47
5.6.110.0070.08021.52
5.6.100.0170.06021.48
5.6.90.0100.08021.51
5.6.80.0030.05320.79
5.5.350.0170.05720.78
5.5.340.0030.06718.32
5.5.330.0070.05020.85
5.5.320.0230.07320.73
5.5.310.0400.07320.71
5.5.300.0030.05718.38
5.5.290.0070.08318.22
5.5.280.0100.04721.42
5.5.270.0100.08021.21
5.5.260.0100.04021.27
5.5.250.0070.06021.06
5.5.240.0100.08720.52
5.4.450.0300.04319.69
5.4.440.0270.06019.68
5.4.430.0300.04719.43
5.4.420.0270.05019.64
5.4.410.0270.04019.31
5.4.400.0300.04019.28
5.4.390.0300.04319.34
5.4.380.0270.03719.22
5.4.370.0300.03719.39
5.4.360.0300.03319.46
5.4.350.0270.04019.38
5.4.340.0270.05319.45
5.4.320.0270.03719.27
5.4.310.0300.05319.42
5.4.300.0270.04319.36
5.4.290.0230.04019.12
5.4.280.0230.04019.41
5.4.270.0300.03719.28
5.4.260.0230.04019.30
5.4.250.0230.04719.18
5.4.240.0270.04319.24
5.4.230.0300.04319.30
5.4.220.0370.04019.36
5.4.210.0300.03719.44
5.4.200.0330.03319.43
5.4.190.0330.03319.43
5.4.180.0430.05719.32
5.4.170.0400.06719.39
5.4.160.0330.03019.28
5.4.150.0300.03719.30
5.4.140.0300.03316.58
5.4.130.0300.03716.55
5.4.120.0270.04016.67
5.4.110.0300.03316.83
5.4.100.0370.02716.58
5.4.90.0270.03716.64
5.4.80.0230.04016.59
5.4.70.0270.04016.63
5.4.60.0330.03016.70
5.4.50.0230.04016.73
5.4.40.0430.04016.52
5.4.30.0270.03716.73
5.4.20.0430.03716.75
5.4.10.0300.03716.52
5.4.00.0370.03016.00
5.3.290.0230.04014.93
5.3.280.0330.03314.87
5.3.270.0230.04014.82
5.3.260.0300.03714.81
5.3.250.0300.03714.89
5.3.240.0300.03314.84
5.3.230.0330.04014.84
5.3.220.0230.04014.76
5.3.210.0300.03714.80
5.3.200.0430.05014.84
5.3.190.0330.03314.75
5.3.180.0270.04014.80
5.3.170.0330.03314.83
5.3.160.0370.03014.84
5.3.150.0300.03714.75
5.3.140.0330.03314.77
5.3.130.0300.03314.82
5.3.120.0200.05014.77
5.3.110.0270.04014.76
5.3.100.0200.04714.35
5.3.90.0400.03714.16
5.3.80.0300.04314.27
5.3.70.0270.03714.24
5.3.60.0300.03314.31
5.3.50.0330.03314.21
5.3.40.0270.06714.22
5.3.30.0170.03714.13
5.3.20.0230.03713.88
5.3.10.0400.05313.80
5.3.00.0230.03713.90
5.2.170.0170.03711.39
5.2.160.0030.03011.38
5.2.150.0230.02011.36
5.2.140.0300.03711.46
5.2.130.0300.06311.37
5.2.120.0200.03011.23
5.2.110.0200.03711.34
5.2.100.0270.03011.38
5.2.90.0270.02311.39
5.2.80.0200.03011.40
5.2.70.0330.05011.19
5.2.60.0230.04711.17
5.2.50.0370.04711.25
5.2.40.0200.02711.21
5.2.30.0200.02711.10
5.2.20.0200.02711.20
5.2.10.0200.02711.17
5.2.00.0170.03010.98
5.1.60.0200.02710.29
5.1.50.0230.02010.28
5.1.40.0170.02710.08
5.1.30.0130.03010.64
5.1.20.0130.03310.58
5.1.10.0330.03310.37
5.1.00.0200.02310.37
5.0.50.0100.0208.76
5.0.40.0100.0238.65
5.0.30.0070.0308.50
5.0.20.0130.0208.47
5.0.10.0100.0178.46
5.0.00.0100.0278.44
4.4.90.0100.0137.87
4.4.80.0130.0237.87
4.4.70.0070.0177.87
4.4.60.0100.0177.87
4.4.50.0100.0207.87
4.4.40.0070.0277.87
4.4.30.0070.0177.87
4.4.20.0070.0137.87
4.4.10.0070.0177.87
4.4.00.0130.0507.87
4.3.110.0070.0137.87
4.3.100.0070.0237.87
4.3.90.0100.0137.87
4.3.80.0100.0207.87
4.3.70.0130.0237.87
4.3.60.0170.0237.87
4.3.50.0030.0207.87
4.3.40.0130.0277.87
4.3.30.0070.0137.87
4.3.20.0070.0107.87
4.3.10.0000.0207.87
4.3.00.0030.0177.87

preferences:
42.82 ms | 401 KiB | 5 Q