3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyXML extends SimpleXMLElement { public function firstChild() { $children = $this->children(); foreach ($children as $child) break; return $child; } public function keyHasTwins($key) { return (bool)count($this->$key); } } $s = '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>'. '<request>'. ' <body>'. ' <rows>'. ' <row id="1"/>'. ' <row id="2"/>'. ' <row id="3"/>'. ' <row2 ver="2.0">test data</row2>'. ' </rows>'. ' </body>'. '</request>'; $obj = new MyXML($s); $rows = $obj->firstChild()->firstChild()->children(); var_dump($rows->keyHasTwins('row')); //foreach ($rows as $row) // var_dump($row);

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.0000.01416.75
8.3.50.0140.00517.61
8.3.40.0040.01218.71
8.3.30.0040.01118.92
8.3.20.0080.00019.04
8.3.10.0080.00020.83
8.3.00.0080.00017.75
8.2.180.0120.00916.75
8.2.170.0030.01422.96
8.2.160.0110.00422.33
8.2.150.0080.00024.18
8.2.140.0000.00724.66
8.2.130.0000.00826.16
8.2.120.0040.00420.20
8.2.110.0040.00721.30
8.2.100.0040.00718.03
8.2.90.0000.00719.42
8.2.80.0040.00418.18
8.2.70.0040.00417.88
8.2.60.0000.00818.18
8.2.50.0000.00818.07
8.2.40.0040.00418.34
8.2.30.0050.00318.24
8.2.20.0000.00817.96
8.2.10.0000.00819.63
8.2.00.0000.00717.86
8.1.280.0070.01425.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00322.67
8.1.230.0000.01121.16
8.1.220.0040.00418.77
8.1.210.0000.00919.04
8.1.200.0030.00717.48
8.1.190.0000.00817.65
8.1.180.0090.00018.10
8.1.170.0000.00719.03
8.1.160.0000.00719.16
8.1.150.0050.00318.94
8.1.140.0040.00417.63
8.1.130.0040.00417.96
8.1.120.0040.00417.76
8.1.110.0000.00817.50
8.1.100.0000.00817.59
8.1.90.0030.00517.78
8.1.80.0040.00417.73
8.1.70.0000.00717.62
8.1.60.0030.00617.84
8.1.50.0000.00717.57
8.1.40.0040.00417.82
8.1.30.0000.00717.78
8.1.20.0030.00517.76
8.1.10.0080.00017.91
8.1.00.0040.00417.72
8.0.300.0080.00020.14
8.0.290.0060.00317.00
8.0.280.0030.00318.73
8.0.270.0000.00717.46
8.0.260.0030.00317.05
8.0.250.0040.00417.26
8.0.240.0030.00717.21
8.0.230.0030.00317.20
8.0.220.0050.00216.97
8.0.210.0000.00716.99
8.0.200.0050.00317.17
8.0.190.0000.00717.23
8.0.180.0000.00717.10
8.0.170.0080.00017.00
8.0.160.0040.00417.20
8.0.150.0030.00516.98
8.0.140.0040.00717.02
8.0.130.0000.00513.55
8.0.120.0040.00416.98
8.0.110.0050.00217.19
8.0.100.0030.00317.01
8.0.90.0040.00416.98
8.0.80.0040.01317.14
8.0.70.0040.00417.23
8.0.60.0000.00716.98
8.0.50.0070.00017.20
8.0.30.0110.00717.15
8.0.20.0090.00917.22
8.0.10.0000.00817.21
8.0.00.0090.00916.89
7.4.330.0000.00513.32
7.4.320.0000.00616.93
7.4.300.0070.00016.64
7.4.290.0000.00716.81
7.4.280.0030.00616.86
7.4.270.0050.00316.93
7.4.260.0060.00013.47
7.4.250.0050.00316.91
7.4.240.0030.00316.85
7.4.230.0000.00716.62
7.4.220.0090.00616.87
7.4.210.0070.00916.81
7.4.200.0050.00316.93
7.4.190.0000.00816.98
7.4.160.0120.00416.61
7.4.150.0040.01416.75
7.4.140.0100.00816.79
7.4.130.0130.00416.79
7.4.120.0080.01216.76
7.4.110.0090.00916.79
7.4.100.0100.00716.81
7.4.90.0070.01016.81
7.4.80.0030.01316.86
7.4.70.0090.01216.75
7.4.60.0060.01116.76
7.4.50.0060.00316.70
7.4.40.0080.00416.80
7.4.30.0100.00616.75
7.4.00.0030.00915.40
7.3.330.0030.00313.38
7.3.320.0000.00613.60
7.3.310.0000.00716.54
7.3.300.0000.00716.63
7.3.290.0120.00316.54
7.3.280.0120.00616.58
7.3.270.0120.00616.79
7.3.260.0130.00716.70
7.3.250.0080.01016.76
7.3.240.0090.01216.69
7.3.230.0140.00616.66
7.3.210.0160.00016.95
7.3.200.0110.01119.39
7.3.190.0130.00816.56
7.3.180.0050.01016.87
7.3.170.0130.00316.92
7.3.160.0080.00816.88
7.3.120.0070.01114.88
7.3.10.0040.00716.23
7.3.00.0050.00916.51
7.2.330.0080.01316.62
7.2.320.0100.01316.77
7.2.310.0070.01216.68
7.2.300.0030.01316.86
7.2.290.0130.00616.75
7.2.130.0050.00817.01
7.2.120.0030.00817.01
7.2.110.0070.00617.12
7.2.100.0100.00217.12
7.2.90.0030.01116.91
7.2.80.0020.01317.10
7.2.70.0020.01016.93
7.2.60.0030.01017.04
7.2.50.0070.00617.07
7.2.40.0060.00817.05
7.2.30.0080.00517.08
7.2.20.0070.00517.07
7.2.10.0060.00716.80
7.2.00.0050.01016.97
7.1.250.0020.00815.58
7.1.240.0000.01116.04
7.1.230.0070.00716.00
7.1.220.0040.00715.89
7.1.210.0110.00415.77
7.1.200.0060.00615.87
7.1.190.0030.00716.09
7.1.180.0060.00616.09
7.1.170.0070.00415.60
7.1.160.0040.00715.94
7.1.150.0040.00715.88
7.1.140.0030.00716.11
7.1.130.0000.01315.90
7.1.120.0000.00816.06
7.1.110.0000.01015.86
7.1.100.0070.00415.98
7.1.90.0040.00415.88
7.1.80.0040.00716.00
7.1.70.0070.00216.50
7.1.60.0060.01217.65
7.1.50.0090.00616.55
7.1.40.0030.00715.62
7.1.30.0040.00716.00
7.1.20.0070.00315.91
7.1.10.0070.00716.10
7.1.00.0020.04119.18
7.0.330.0090.00315.54
7.0.320.0030.00915.59
7.0.310.0030.00915.50
7.0.300.0030.00715.41
7.0.290.0040.00715.36
7.0.280.0070.00715.49
7.0.270.0120.00615.24
7.0.260.0000.01015.51
7.0.250.0070.00315.70
7.0.240.0070.00715.52
7.0.230.0070.00715.51
7.0.220.0040.00415.21
7.0.210.0040.00415.18
7.0.200.0060.00416.10
7.0.190.0130.00015.59
7.0.180.0090.00015.51
7.0.170.0060.00615.39
7.0.160.0030.00715.34
7.0.150.0000.01315.49
7.0.140.0030.03818.86
7.0.130.0040.00415.48
7.0.120.0050.03718.88
7.0.110.0050.00515.37
7.0.100.0050.00915.55
7.0.90.0000.01115.44
7.0.80.0000.01115.41
7.0.70.0040.00815.60
7.0.60.0080.03717.71
7.0.50.0140.02716.62
7.0.40.0050.02416.97
7.0.30.0160.04416.96
7.0.20.0200.02816.87
7.0.10.0070.02616.92
7.0.00.0040.02416.75
5.6.380.0030.00714.39
5.6.370.0000.01114.15
5.6.360.0030.00614.58
5.6.350.0040.00714.49
5.6.340.0000.00814.20
5.6.330.0050.00614.45
5.6.320.0110.00014.42
5.6.310.0080.00414.21
5.6.300.0110.00414.04
5.6.290.0040.01114.64
5.6.280.0080.03817.68
5.6.270.0000.01214.23
5.6.260.0070.00314.76
5.6.250.0030.00814.39
5.6.240.0060.00614.39
5.6.230.0040.00414.18
5.6.220.0080.00614.38
5.6.210.0050.04617.41
5.6.200.0040.02716.21
5.6.190.0120.03617.45
5.6.180.0150.04817.49
5.6.170.0090.02617.46
5.6.160.0060.04617.32
5.6.150.0060.04116.18
5.6.140.0020.04716.33
5.6.130.0110.03716.28
5.6.120.0020.02917.51
5.6.110.0060.03817.72
5.6.100.0050.04717.68
5.6.90.0100.04017.64
5.6.80.0070.04317.30
5.6.70.1940.01917.30
5.6.60.0100.00014.39
5.6.50.0040.00814.14
5.6.40.0060.00614.32
5.6.30.0030.00714.39
5.6.20.0070.00714.12
5.6.10.0030.01214.36
5.6.00.0090.00614.11
5.5.380.0030.00511.48
5.5.370.0000.00911.18
5.5.360.0000.00711.54
5.5.350.0190.04015.91
5.5.340.0030.03014.58
5.5.330.0030.04015.83
5.5.320.0080.02415.89
5.5.310.0230.02815.78
5.5.300.0120.03714.84
5.5.290.0070.02814.64
5.5.280.0000.03316.01
5.5.270.0070.04016.05
5.5.260.0060.04816.12
5.5.250.0050.04415.93
5.5.240.0020.02215.71
5.5.230.0000.00711.18
5.5.220.0080.00311.18
5.5.210.0000.00911.18
5.5.200.0110.00011.18
5.5.190.0050.00511.18
5.5.180.0060.00311.18
5.5.170.0050.00311.40
5.5.160.0030.00311.23
5.5.150.0030.00711.18
5.5.140.0000.00711.26
5.5.130.0060.00611.18
5.5.120.0030.00611.18
5.5.110.0030.00711.31
5.5.100.0080.00411.18
5.5.90.0000.01011.18
5.5.80.0030.00311.18
5.5.70.0030.00711.18
5.5.60.0030.00611.18
5.5.50.0040.00411.25
5.5.40.0040.00411.30
5.5.30.0100.00311.37
5.5.20.0110.00411.20
5.5.10.0080.00411.18
5.5.00.0060.00611.18
5.4.450.0030.02415.43
5.4.440.0080.02015.35
5.4.430.0060.02215.38
5.4.420.0030.02115.33
5.4.410.0010.02415.29
5.4.400.0040.02215.12
5.4.390.0030.02615.23
5.4.380.0030.02015.28
5.4.370.0060.01915.28
5.4.360.0080.01815.28
5.4.350.0020.02415.14
5.4.340.0020.02415.31
5.4.330.0000.01111.18
5.4.320.0030.02215.20
5.4.310.0050.02215.31
5.4.300.0030.02315.05
5.4.290.0020.03015.23
5.4.280.0060.02115.12
5.4.270.0050.03715.11
5.4.260.0040.02215.20
5.4.250.0060.02515.20
5.4.240.0090.03915.18
5.4.230.0050.02915.11
5.4.220.0020.02515.05
5.4.210.0100.03715.23
5.4.200.0090.03915.26
5.4.190.0070.04015.24
5.4.180.0050.04215.24
5.4.170.0030.04515.30
5.4.160.0050.02415.18
5.4.150.0080.04015.04
5.4.140.0110.02713.84
5.4.130.0070.02513.90
5.4.120.0070.03313.91
5.4.110.0050.03913.80
5.4.100.0050.03813.95
5.4.90.0100.03313.86
5.4.80.0050.02313.89
5.4.70.0060.03813.86
5.4.60.0050.02913.86
5.4.50.0070.03713.87
5.4.40.0040.03213.87
5.4.30.0020.04213.88
5.4.20.0050.03813.85
5.4.10.0070.03813.83
5.4.00.0080.02313.58
5.3.290.0050.01812.99
5.3.280.0080.03412.96
5.3.270.0050.02112.91
5.3.260.0080.03712.97
5.3.250.0000.02712.94
5.3.240.0100.03312.89
5.3.230.0050.04012.96
5.3.220.0080.03312.99
5.3.210.0080.04312.88
5.3.200.0050.02912.93
5.3.190.0080.03612.94
5.3.180.0070.03712.95
5.3.170.0050.03712.87
5.3.160.0100.03312.97
5.3.150.0050.02512.95
5.3.140.0070.03312.93
5.3.130.0070.04312.92
5.3.120.0030.02712.93
5.3.110.0100.03412.94
5.3.100.0100.03312.65
5.3.90.0060.02212.67
5.3.80.0030.02212.66
5.3.70.0100.03212.70
5.3.60.0060.02612.68
5.3.50.0030.02212.64
5.3.40.0050.04112.63
5.3.30.0050.04012.62
5.3.20.0050.03212.51
5.3.10.0030.02812.52
5.3.00.0070.01812.53
5.2.170.0000.02011.23
5.2.160.0000.02711.21
5.2.150.0000.03411.24
5.2.140.0030.02211.18
5.2.130.0050.03211.20
5.2.120.0000.02011.22
5.2.110.0040.01911.25
5.2.100.0020.02811.16
5.2.90.0020.01911.21
5.2.80.0050.02711.21
5.2.70.0080.02811.21
5.2.60.0060.03011.18
5.2.50.0020.03511.15
5.2.40.0060.02611.17
5.2.30.0070.03211.09
5.2.20.0030.03211.16
5.2.10.0040.02411.07
5.2.00.0020.03310.97
5.1.60.0030.02210.70
5.1.50.0000.02510.68
5.1.40.0020.02710.65
5.1.30.0070.02810.80
5.1.20.0030.02810.81
5.1.10.0020.01810.67
5.1.00.0010.01810.70
5.0.50.0050.0209.97
5.0.40.0000.0289.87
5.0.30.0030.0259.76
5.0.20.0060.0239.77
5.0.10.0020.0279.75
5.0.00.0020.0279.69
4.4.90.0000.0249.47
4.4.80.0000.0169.47
4.4.70.0020.0189.47
4.4.60.0020.0149.47
4.4.50.0020.0149.47
4.4.40.0030.0219.47
4.4.30.0020.0169.47
4.4.20.0000.0149.47
4.4.10.0010.0169.47
4.4.00.0000.0329.47
4.3.110.0000.0149.47
4.3.100.0050.0089.47
4.3.90.0000.0119.47
4.3.80.0020.0179.47
4.3.70.0070.0159.47
4.3.60.0030.0099.47
4.3.50.0010.0109.47
4.3.40.0000.0169.47
4.3.30.0020.0109.47
4.3.20.0030.0129.47
4.3.10.0000.0119.47
4.3.00.0020.0179.47

preferences:
40.74 ms | 401 KiB | 5 Q