3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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; $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; $document = new DOMDocument(); $document->loadXML($xml); $document->schemaValidateSource($schema, LIBXML_SCHEMA_CREATE); $document->resolveExternals = true; $document->substituteEntities = true; $xpath = new DOMXPath($document); foreach ($xpath->query('//item') as $item) { echo $item->getNodePath() . PHP_EOL . ' is-foo : ' . ($item->getAttribute('is-foo') === 'true' ? 'true' : 'false') . PHP_EOL . ' is-bar : ' . ($item->getAttribute('is-bar') === 'true' ? 'true' : 'false') . 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.130.0150.00319.27
8.3.120.0060.00319.70
8.3.110.0060.00320.94
8.3.100.0080.00417.48
8.3.90.0110.00426.77
8.3.80.0060.00619.18
8.3.70.0110.01117.38
8.3.60.0090.00917.25
8.3.50.0140.00218.84
8.3.40.0090.00619.60
8.3.30.0030.01319.71
8.3.20.0040.00419.65
8.3.10.0040.00419.52
8.3.00.0040.00420.25
8.2.250.0080.00017.19
8.2.240.0120.00317.98
8.2.230.0060.00322.58
8.2.220.0070.00324.06
8.2.210.0080.00026.77
8.2.200.0060.00318.80
8.2.190.0120.00417.13
8.2.180.0220.00017.13
8.2.170.0120.00322.96
8.2.160.0090.00619.76
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00020.41
8.2.110.0060.00321.80
8.2.100.0040.01118.66
8.2.90.0040.00418.96
8.2.80.0040.00420.03
8.2.70.0030.00618.38
8.2.60.0030.00618.54
8.2.50.0040.00418.55
8.2.40.0050.00520.10
8.2.30.0060.00318.54
8.2.20.0090.00018.38
8.2.10.0000.00818.48
8.2.00.0000.00818.48
8.1.300.0100.01018.69
8.1.290.0110.00030.84
8.1.280.0190.00325.92
8.1.270.0090.00023.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0120.00022.81
8.1.230.0060.00621.60
8.1.220.0030.00518.53
8.1.210.0000.00919.43
8.1.200.0000.00918.00
8.1.190.0060.00317.86
8.1.180.0060.00318.10
8.1.170.0050.00318.00
8.1.160.0000.00819.67
8.1.150.0000.00819.45
8.1.140.0070.00018.04
8.1.130.0000.00718.16
8.1.120.0000.00718.19
8.1.110.0050.00318.04
8.1.100.0070.00018.22
8.1.90.0050.00318.14
8.1.80.0040.00418.25
8.1.70.0030.00518.05
8.1.60.0080.00018.34
8.1.50.0000.00818.07
8.1.40.0080.00018.11
8.1.30.0060.00318.44
8.1.20.0070.00218.34
8.1.10.0080.00018.26
8.1.00.0050.00318.24
8.0.300.0060.00320.79
8.0.290.0040.00417.50
8.0.280.0040.00419.26
8.0.270.0000.00717.95
8.0.260.0030.00317.50
8.0.250.0050.00317.82
8.0.240.0060.00317.80
8.0.230.0060.00317.73
8.0.220.0030.00517.70
8.0.210.0000.00817.77
8.0.200.0030.00317.62
8.0.190.0000.00817.76
8.0.180.0080.00017.76
8.0.170.0040.00417.79
8.0.160.0040.00417.82
8.0.150.0040.00417.59
8.0.140.0000.01117.67
8.0.130.0030.00314.29
8.0.120.0030.00617.56
8.0.110.0030.00517.66
8.0.100.0080.00017.58
8.0.90.0060.00317.67
8.0.80.0080.00817.76
8.0.70.0030.00517.69
8.0.60.0030.00617.56
8.0.50.0040.00417.63
8.0.30.0110.00717.70
8.0.20.0130.00917.87
8.0.10.0040.00417.72
8.0.00.0110.00817.38
7.4.330.0020.00513.68
7.4.320.0030.00317.29
7.4.300.0080.00017.14
7.4.290.0040.00417.25
7.4.280.0040.00517.24
7.4.270.0070.00017.20
7.4.260.0030.00314.09
7.4.250.0060.00317.20
7.4.240.0000.00917.20
7.4.230.0050.00317.28
7.4.220.0140.00617.43
7.4.210.0070.01317.34
7.4.200.0070.00017.07
7.4.190.0040.00417.30
7.4.160.0060.01017.21
7.4.150.0120.00817.26
7.4.140.0120.01317.86
7.4.130.0130.00717.26
7.4.120.0140.00317.20
7.4.110.0120.00617.08
7.4.100.0160.00317.36
7.4.90.0140.00317.29
7.4.80.0090.00819.39
7.4.70.0090.01417.23
7.4.60.0140.00317.20
7.4.50.0030.00617.32
7.4.40.0090.00617.08
7.4.30.0140.00317.16
7.4.00.0030.01615.54
7.3.330.0030.00313.95
7.3.320.0030.00313.80
7.3.310.0040.00416.82
7.3.300.0050.00217.04
7.3.290.0130.00316.97
7.3.280.0150.00016.88
7.3.270.0110.00617.17
7.3.260.0160.00417.32
7.3.240.0160.00016.99
7.3.230.0110.00717.10
7.3.210.0030.01616.87
7.3.200.0140.00317.23
7.3.190.0080.00817.18
7.3.180.0120.00617.23
7.3.170.0170.00717.12
7.3.160.0060.01017.02
7.3.120.0070.01015.31
7.2.340.0140.00216.89
7.2.330.0100.01017.25
7.2.320.0000.01717.49
7.2.310.0070.02017.48
7.2.300.0080.01117.33
7.2.290.0090.01617.13
7.2.60.0180.00816.96
7.2.50.0030.00917.30
7.1.200.0030.00816.16
7.1.100.0030.01018.46
7.1.70.0070.00317.55
7.1.60.0060.01919.21
7.1.50.0000.02217.15
7.1.00.0070.04322.80
7.0.200.0030.00817.16
7.0.140.0000.07722.45
7.0.120.0000.04722.45
7.0.110.0100.07722.18
7.0.100.0070.07322.34
7.0.90.0030.08022.33
7.0.80.0130.06722.15
7.0.70.0100.07322.26
7.0.60.0070.04722.34
7.0.50.0070.08022.17
7.0.40.0100.05720.14
7.0.30.0130.04320.11
7.0.20.0030.04720.17
7.0.10.0070.04720.19
7.0.00.0070.07020.21
5.6.280.0000.07721.55
5.6.260.0100.07020.99
5.6.250.0200.06021.03
5.6.240.0030.07721.00
5.6.230.0000.06320.95
5.6.220.0030.04721.28
5.6.210.0070.05021.18
5.6.200.0030.08021.11
5.6.190.0000.08721.23
5.6.180.0170.04321.02
5.6.170.0030.08021.04
5.6.160.0070.04021.09
5.6.150.0130.04720.92
5.6.140.0170.03021.08
5.6.130.0230.06321.21
5.6.120.0070.06320.92
5.6.110.0070.06721.09
5.6.100.0070.04321.10
5.6.90.0070.08321.03
5.6.80.0130.07020.46
5.6.70.0030.07720.43
5.6.60.0070.06720.69
5.6.50.0100.04320.39
5.6.40.0170.06720.38
5.6.30.0100.04320.35
5.6.20.0030.04020.40
5.6.10.0200.05320.37
5.6.00.0100.06320.38
5.5.380.0030.04718.00
5.5.370.0030.07718.04
5.5.360.0000.04017.98
5.5.350.0030.03717.94
5.5.340.0170.06018.62
5.5.330.0070.06718.68
5.5.320.0100.07018.68
5.5.310.0000.09018.46
5.5.300.0030.08018.46
5.5.290.0070.06718.27
5.5.280.0100.07318.69
5.5.270.0070.04318.42
5.5.260.0000.06718.71
5.5.250.0100.04018.05
5.5.240.0030.03718.11
5.5.230.0030.08017.81
5.5.220.0070.07717.61
5.5.210.0030.04317.84
5.5.200.0070.07017.89
5.5.190.0030.04717.49
5.5.180.0030.04017.71
5.5.160.0030.05017.80
5.5.150.0100.04017.63
5.5.140.0100.07017.62
5.5.130.0030.05017.81
5.5.120.0070.07718.03
5.5.110.0030.07718.07
5.5.100.0030.07317.54
5.5.90.0130.06317.68
5.5.80.0070.04317.61
5.5.70.0070.05017.77
5.5.60.0100.07017.74
5.5.50.0070.08317.76
5.5.40.0030.07317.71
5.5.30.0070.04717.94
5.5.20.0030.06317.52
5.5.10.0030.06717.45
5.5.00.0070.04317.57
5.4.450.0100.05019.55
5.4.440.0030.05019.73
5.4.430.0030.04719.53
5.4.420.0030.04719.46
5.4.410.0030.07319.48
5.4.400.0030.05319.17
5.4.390.0100.06319.17
5.4.380.0200.06719.14
5.4.370.0070.07719.07
5.4.360.0070.04019.44
5.4.350.0070.04319.25
5.4.340.0030.04319.41
5.4.320.0070.06019.39
5.4.310.0100.05719.32
5.4.300.0100.06319.39
5.4.290.0070.06019.09
5.4.280.0030.04719.30
5.4.270.0070.07019.39
5.4.260.0070.07319.28
5.4.250.0100.05319.34
5.4.240.0030.05319.48
5.4.230.0070.07719.41
5.4.220.0000.08019.48
5.4.210.0100.06719.30
5.4.200.0030.04719.48
5.4.190.0070.07319.31
5.4.180.0030.04719.47
5.4.170.0070.05019.48
5.4.160.0000.05719.23
5.4.150.0070.06019.13
5.4.140.0070.07316.79
5.4.130.0030.03316.62
5.4.120.0070.06016.79
5.4.110.0070.07316.80
5.4.100.0030.03716.79
5.4.90.0000.05716.66
5.4.80.0070.04316.64
5.4.70.0000.04016.64
5.4.60.0100.05016.55
5.4.50.0070.03316.75
5.4.40.0030.04016.58
5.4.30.0070.03716.39
5.4.20.0070.07016.57
5.4.10.0030.07016.74
5.4.00.0100.06016.24
5.3.290.0070.07314.89
5.3.280.0170.05714.89
5.3.270.0000.04714.99
5.3.260.0000.06314.89
5.3.250.0030.04714.86
5.3.240.0000.04714.75
5.3.230.0130.03014.94
5.3.220.0030.07314.80
5.3.210.0000.06014.79
5.3.200.0030.07714.91
5.3.190.0030.03714.68
5.3.180.0030.07314.86
5.3.170.0000.07014.80
5.3.160.0100.07714.86
5.3.150.0000.06314.73
5.3.140.0070.05314.72
5.3.130.0130.07014.80
5.3.120.0070.04314.89
5.3.110.0030.04714.71
5.3.100.0070.06314.33
5.3.90.0030.07014.30
5.3.80.0070.06014.17
5.3.70.0030.06314.27
5.3.60.0030.06314.29
5.3.50.0100.05714.24
5.3.40.0000.05314.24
5.3.30.0030.05014.16
5.3.20.0070.03013.83
5.3.10.0000.07013.84
5.3.00.0000.03313.91
5.2.170.0070.05712.38
5.2.160.0000.05312.38
5.2.150.0000.05312.38
5.2.140.0000.04312.38
5.2.130.0030.04712.38
5.2.120.0000.06312.38
5.2.110.0070.05012.38
5.2.100.0000.05012.38
5.2.90.0000.04012.38
5.2.80.0030.05712.38
5.2.70.0070.02012.38
5.2.60.0030.04712.38
5.2.50.0000.02712.38
5.2.40.0070.02012.38
5.2.30.0030.05312.38
5.2.20.0030.05712.38
5.2.10.0000.06712.38
5.2.00.0030.02712.38
5.1.60.0030.05712.38
5.1.50.0030.02312.38
5.1.40.0000.03312.38
5.1.30.0030.04312.38
5.1.20.0000.03012.38
5.1.10.0000.02712.38
5.1.00.0000.04312.38
5.0.50.0000.04712.38
5.0.40.0030.02712.38
5.0.30.0070.05712.38
5.0.20.0000.02312.38
5.0.10.0000.03712.38
5.0.00.0000.05012.38
4.4.90.0030.01012.38
4.4.80.0000.02712.38
4.4.70.0000.01312.38
4.4.60.0000.01312.38
4.4.50.0030.03012.38
4.4.40.0000.04312.38
4.4.30.0030.01312.38
4.4.20.0000.01312.38
4.4.10.0000.01312.38
4.4.00.0000.02312.38
4.3.110.0000.02312.38
4.3.100.0030.01012.38
4.3.90.0030.01012.38
4.3.80.0030.04012.38
4.3.70.0030.02712.38
4.3.60.0000.01712.38
4.3.50.0000.03012.38
4.3.40.0030.02012.38
4.3.30.0030.03312.38
4.3.20.0030.01312.38
4.3.10.0000.01312.38
4.3.00.0000.03012.38

preferences:
45.86 ms | 403 KiB | 5 Q