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) { if (isset($this->$key)) return (count($this->$key)>1); else return false; } public function hasChildren() { return (bool)count($this->children()); } } $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>'. ' <row2 ver="2.1">test data 2</row2>'. ' </rows>'. ' </body>'. '</request>'; $obj = new MyXML($s); $rows = $obj->firstChild()->firstChild()->children(); var_dump($rows->hasChildren('row')); var_dump($rows->hasChildren('row2')); var_dump($rows->hasChildren('my-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.40.0090.00619.09
8.3.30.0120.00318.96
8.3.20.0050.00318.93
8.3.10.0050.00319.00
8.3.00.0030.00519.63
8.2.170.0140.00022.96
8.2.160.0090.00620.60
8.2.150.0060.00324.18
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00422.49
8.2.110.0030.00721.07
8.2.100.0070.00418.16
8.2.90.0060.00319.59
8.2.80.0040.00419.34
8.2.70.0090.00017.63
8.2.60.0060.00318.18
8.2.50.0050.00318.07
8.2.40.0050.00218.47
8.2.30.0040.00418.35
8.2.20.0000.00717.85
8.2.10.0080.00017.96
8.2.00.0080.00018.03
8.1.270.0080.00024.66
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00322.63
8.1.230.0110.00021.01
8.1.220.0030.00517.91
8.1.210.0030.00519.23
8.1.200.0060.00317.61
8.1.190.0000.00717.66
8.1.180.0040.00418.10
8.1.170.0000.00819.00
8.1.160.0000.00819.01
8.1.150.0050.00218.87
8.1.140.0040.00417.71
8.1.130.0000.00718.04
8.1.120.0040.00417.80
8.1.110.0030.00517.60
8.1.100.0000.00717.55
8.1.90.0000.00717.57
8.1.80.0070.00017.72
8.1.70.0080.00017.77
8.1.60.0080.00017.85
8.1.50.0000.00817.62
8.1.40.0000.00717.65
8.1.30.0030.00617.78
8.1.20.0050.00317.79
8.1.10.0030.00517.70
8.1.00.0060.00317.80
8.0.300.0000.00720.02
8.0.290.0030.00616.88
8.0.280.0030.00318.71
8.0.270.0030.00317.43
8.0.260.0000.00716.95
8.0.250.0000.00817.15
8.0.240.0000.00717.07
8.0.230.0070.00017.20
8.0.220.0000.00717.05
8.0.210.0000.01017.19
8.0.200.0000.00817.04
8.0.190.0030.00317.22
8.0.180.0000.00817.19
8.0.170.0050.00317.16
8.0.160.0070.00017.05
8.0.150.0000.00917.13
8.0.140.0070.00617.11
8.0.130.0000.00513.59
8.0.120.0000.00717.15
8.0.110.0030.00517.11
8.0.100.0000.00717.17
8.0.90.0070.00017.03
8.0.80.0060.00917.11
8.0.70.0000.00717.02
8.0.60.0030.00616.98
8.0.50.0020.00516.93
8.0.30.0140.01117.07
8.0.20.0110.01117.27
8.0.10.0040.00416.99
8.0.00.0090.01217.03
7.4.330.0000.00513.19
7.4.320.0000.00616.72
7.4.300.0000.00616.82
7.4.290.0030.00616.73
7.4.280.0040.00416.86
7.4.270.0070.00016.84
7.4.260.0030.00313.50
7.4.250.0030.00616.82
7.4.240.0030.00516.89
7.4.230.0030.00316.62
7.4.220.0100.01316.79
7.4.210.0080.00916.85
7.4.200.0070.00016.78
7.4.190.0040.00416.98
7.4.160.0100.00716.89
7.4.150.0070.01016.75
7.4.140.0110.00616.83
7.4.130.0060.01116.86
7.4.120.0070.01316.75
7.4.110.0090.00916.73
7.4.100.0030.01616.86
7.4.90.0130.00916.67
7.4.80.0080.01119.39
7.4.70.0080.00816.83
7.4.60.0060.00916.88
7.4.50.0060.00616.66
7.4.40.0040.01116.77
7.4.30.0040.01916.73
7.4.10.0110.00714.92
7.4.00.0030.01215.08
7.3.330.0050.00213.53
7.3.320.0030.00313.55
7.3.310.0040.00316.59
7.3.300.0000.00716.50
7.3.290.0070.00716.51
7.3.280.0100.00716.54
7.3.270.0140.00316.56
7.3.260.0120.00916.59
7.3.250.0110.00716.85
7.3.240.0100.00716.54
7.3.230.0050.01116.46
7.3.210.0080.01416.81
7.3.200.0060.00916.89
7.3.190.0080.01116.81
7.3.180.0040.01216.84
7.3.170.0140.00716.78
7.3.160.0080.00816.85
7.3.130.0000.01815.03
7.3.120.0120.00514.96
7.3.110.0050.00514.76
7.3.100.0000.01214.93
7.3.90.0120.00614.97
7.3.80.0080.00414.84
7.3.70.0100.00014.80
7.3.60.0030.00715.09
7.3.50.0030.01215.07
7.3.40.0000.01214.80
7.3.30.0060.00615.00
7.3.20.0040.01116.50
7.3.10.0080.00616.68
7.3.00.0050.00716.85
7.2.330.0100.01016.68
7.2.320.0120.00616.72
7.2.310.0110.00816.64
7.2.300.0100.01017.01
7.2.290.0120.00416.66
7.2.260.0070.01315.18
7.2.250.0060.01615.27
7.2.240.0070.01115.36
7.2.230.0030.01315.05
7.2.220.0100.00715.42
7.2.210.0090.00615.06
7.2.200.0000.01215.34
7.2.190.0090.00615.11
7.2.180.0000.01115.04
7.2.170.0000.01315.01
7.2.160.0040.01215.07
7.2.150.0070.00316.71
7.2.140.0070.01017.05
7.2.130.0030.00916.99
7.2.120.0060.00617.09
7.2.110.0070.00517.10
7.2.100.0030.01317.10
7.2.90.0050.01117.14
7.2.80.0060.01017.07
7.2.70.0050.00717.11
7.2.60.0020.01117.11
7.2.50.0050.00817.03
7.2.40.0020.01017.15
7.2.30.0070.00716.96
7.2.20.0080.00717.06
7.2.10.0050.00916.96
7.2.00.0050.00817.77
7.1.330.0110.00315.78
7.1.320.0080.00915.93
7.1.310.0060.00915.75
7.1.300.0080.00815.92
7.1.290.0080.00015.61
7.1.280.0000.01015.97
7.1.270.0000.01115.91
7.1.260.0040.01115.89
7.1.250.0040.00915.98
7.1.240.0030.01015.66
7.1.230.0070.01016.18
7.1.220.0090.00615.63
7.1.210.0030.01015.81
7.1.200.0050.00515.68
7.1.190.0060.00315.97
7.1.180.0040.00815.80
7.1.170.0090.00615.87
7.1.160.0050.00815.73
7.1.150.0110.00416.03
7.1.140.0080.00415.67
7.1.130.0060.00315.90
7.1.120.0080.00015.76
7.1.110.0030.00915.79
7.1.100.0070.00717.09
7.1.90.0060.00615.82
7.1.80.0080.00315.70
7.1.70.0050.00516.59
7.1.60.0050.01417.67
7.1.50.0060.00916.47
7.1.40.0070.00315.82
7.1.30.0070.00415.92
7.1.20.0060.00615.78
7.1.10.0040.00815.88
7.1.00.0030.02219.19
7.0.330.0070.00715.37
7.0.320.0070.01015.68
7.0.310.0030.00715.45
7.0.300.0040.00415.43
7.0.290.0000.01015.32
7.0.280.0060.00315.43
7.0.270.0030.01115.35
7.0.260.0070.00415.43
7.0.250.0150.00015.49
7.0.240.0060.00915.54
7.0.230.0040.00415.73
7.0.220.0070.00715.72
7.0.210.0000.00915.40
7.0.200.0330.00914.96
7.0.190.0030.01215.59
7.0.180.0030.01015.40
7.0.170.0040.00715.61
7.0.160.0100.00315.42
7.0.150.0040.00815.66
7.0.140.0050.04018.72
7.0.130.0090.00315.59
7.0.120.0060.02818.91
7.0.110.0070.00315.78
7.0.100.0090.00615.43
7.0.90.0000.01015.31
7.0.80.0000.00915.65
7.0.70.0060.00915.61
7.0.60.0080.03817.78
7.0.50.0080.04416.79
7.0.40.0030.03416.92
7.0.30.0200.03917.01
7.0.20.0140.02716.90
7.0.10.0080.03516.91
7.0.00.0030.02516.94
5.6.400.0030.01014.62
5.6.390.0070.00714.39
5.6.380.0030.01314.81
5.6.370.0100.00314.61
5.6.360.0030.00614.10
5.6.350.0070.00314.24
5.6.340.0000.01214.69
5.6.330.0040.00714.47
5.6.320.0070.00314.41
5.6.310.0060.00614.21
5.6.300.0040.01114.84
5.6.290.0060.00914.35
5.6.280.0070.03917.85
5.6.270.0090.00314.57
5.6.260.0060.00614.85
5.6.250.0070.00314.55
5.6.240.0090.00614.33
5.6.230.0100.00314.49
5.6.220.0070.00714.41
5.6.210.0110.03117.45
5.6.200.0060.04316.36
5.6.190.0100.04617.59
5.6.180.1630.02517.56
5.6.170.0220.03917.57
5.6.160.0050.05017.37
5.6.150.0100.02016.36
5.6.140.0070.02516.43
5.6.130.0060.02316.30
5.6.120.0080.02717.96
5.6.110.0050.04817.72
5.6.100.0110.04317.85
5.6.90.0090.04517.77
5.6.80.0080.03817.34
5.6.70.0090.00014.36
5.6.60.0070.00714.76
5.6.50.0000.01014.32
5.6.40.0000.01114.18
5.6.30.0110.00314.38
5.6.20.0060.01014.32
5.6.10.0070.00714.25
5.6.00.0040.01214.07
5.5.380.0030.01014.67
5.5.370.0060.00914.29
5.5.360.0060.00914.10
5.5.350.0050.04717.53
5.5.340.0050.04916.25
5.5.330.0100.04517.56
5.5.320.0180.03517.50
5.5.310.0170.04517.40
5.5.300.0080.04016.25
5.5.290.0030.03716.27
5.5.280.0070.04517.68
5.5.270.0100.03317.60
5.5.260.0040.04717.74
5.5.250.0030.02717.61
5.5.240.2090.01917.38
5.5.230.0070.00714.46
5.5.220.0100.00614.25
5.5.210.0090.00614.24
5.5.200.0090.00014.30
5.5.190.0060.00914.46
5.5.180.0000.01614.26
5.5.170.0030.01014.48
5.5.160.0090.00614.15
5.5.150.0060.00914.55
5.5.140.0070.00714.46
5.5.130.0030.01014.50
5.5.120.0030.00914.55
5.5.110.0030.00814.48
5.5.100.0080.00814.39
5.5.90.0030.00714.34
5.5.80.0070.00714.47
5.5.70.0000.01214.28
5.5.60.0040.00814.11
5.5.50.0090.00613.91
5.5.40.0030.00614.42
5.5.30.0060.00614.41
5.5.20.0060.00914.20
5.5.10.0030.00914.42
5.5.00.0030.00914.14
5.4.450.0150.03615.47
5.4.440.0060.03515.33
5.4.430.0090.02915.39
5.4.420.0030.03815.46
5.4.410.0070.03515.52
5.4.400.0070.03615.18
5.4.390.0020.03515.43
5.4.380.0050.03515.28
5.4.370.0070.03015.23
5.4.360.0090.03815.42
5.4.350.0080.04215.23
5.4.340.0120.03015.30
5.4.330.0000.00911.41
5.4.320.0070.04515.17
5.4.310.0080.03715.30
5.4.300.0060.03015.23
5.4.290.0030.03615.16
5.4.280.0100.03715.23
5.4.270.0060.03515.23
5.4.260.0050.04315.39
5.4.250.0070.02815.35
5.4.240.0020.02615.34
5.4.230.0030.02315.39
5.4.220.0040.03515.34
5.4.210.0030.04315.38
5.4.200.0050.03815.42
5.4.190.0030.02915.23
5.4.180.0030.02515.18
5.4.170.0070.02215.16
5.4.160.0060.02515.38
5.4.150.0050.02515.38
5.4.140.0080.03613.92
5.4.130.0050.03714.00
5.4.120.0050.03413.91
5.4.110.0070.02213.96
5.4.100.0070.03814.11
5.4.90.0040.04313.90
5.4.80.0050.03314.06
5.4.70.0090.02713.97
5.4.60.0110.01513.97
5.4.50.0070.02014.00
5.4.40.0030.02113.97
5.4.30.0020.02213.97
5.4.20.0030.02313.98
5.4.10.0020.02113.96
5.4.00.0050.01813.70
5.3.290.0050.03813.12
5.3.280.0050.04413.12
5.3.270.0020.02513.06
5.3.260.0040.02113.07
5.3.250.0050.03913.08
5.3.240.0100.03613.01
5.3.230.0080.03713.08
5.3.220.0050.04213.11
5.3.210.0050.03713.09
5.3.200.0060.03012.99
5.3.190.0030.04013.09
5.3.180.0060.04013.04
5.3.170.0090.02513.09
5.3.160.0030.02313.04
5.3.150.0020.04213.10
5.3.140.0020.02713.06
5.3.130.0070.01813.08
5.3.120.0030.02313.04
5.3.110.0020.02313.05
5.3.100.0050.02012.83
5.3.90.0020.02412.77
5.3.80.0020.02712.77
5.3.70.0050.02312.84
5.3.60.0050.02012.76
5.3.50.0020.02112.68
5.3.40.0050.01912.76
5.3.30.0060.02212.78
5.3.20.0050.01812.62
5.3.10.0030.02012.65
5.3.00.0020.02212.60
5.2.170.0070.02311.19
5.2.160.0070.02711.30
5.2.150.0030.03011.18
5.2.140.0000.03311.15
5.2.130.0030.02711.31
5.2.120.0000.03011.25
5.2.110.0000.03011.25
5.2.100.0030.02711.27
5.2.90.0070.02311.25
5.2.80.0000.03011.25
5.2.70.0030.02711.13
5.2.60.0030.02711.29
5.2.50.0000.03011.16
5.2.40.0070.02311.14
5.2.30.0000.03011.09
5.2.20.0030.02711.11
5.2.10.0000.03010.91
5.2.00.0030.03310.86
5.1.60.0030.02310.14
5.1.50.0030.02310.18
5.1.40.0030.02010.13
5.1.30.0070.02010.33
5.1.20.0000.02710.54
5.1.10.0000.02710.25
5.1.00.0000.02710.17
5.0.50.0000.0238.60
5.0.40.0000.0208.55
5.0.30.0000.0308.32
5.0.20.0000.0208.33
5.0.10.0000.0208.31
5.0.00.0000.0308.35
4.4.90.0030.0138.02
4.4.80.0000.0138.02
4.4.70.0000.0178.02
4.4.60.0030.0138.02
4.4.50.0030.0138.02
4.4.40.0000.0238.02
4.4.30.0000.0178.02
4.4.20.0030.0138.02
4.4.10.0000.0178.02
4.4.00.0000.0278.02
4.3.110.0000.0178.02
4.3.100.0000.0138.02
4.3.90.0000.0178.02
4.3.80.0000.0238.02
4.3.70.0000.0138.02
4.3.60.0000.0178.02
4.3.50.0000.0138.02
4.3.40.0030.0208.02
4.3.30.0000.0178.02
4.3.20.0000.0178.02
4.3.10.0000.0178.02
4.3.00.0030.0338.02

preferences:
49.86 ms | 400 KiB | 5 Q