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() { var_dump(count($this->children())); 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>'. ' <row3 ver="3.0">'. ' <test>data</test>'. ' </row3>'. ' </rows>'. ' </body>'. '</request>'; $obj = new MyXML($s); $rows = $obj->firstChild()->firstChild(); var_dump($rows->children(), $rows->hasChildren('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.0030.01718.79
8.3.50.0070.01021.39
8.3.40.0110.00418.95
8.3.30.0130.00618.79
8.3.20.0040.00418.89
8.3.10.0000.00820.79
8.3.00.0060.00319.40
8.2.180.0110.00416.75
8.2.170.0140.00422.96
8.2.160.0080.00622.28
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0080.00019.89
8.2.110.0130.01321.31
8.2.100.0070.00417.66
8.2.90.0030.00619.22
8.2.80.0030.00518.05
8.2.70.0000.00917.75
8.2.60.0000.00918.16
8.2.50.0050.00318.16
8.2.40.0040.00418.47
8.2.30.0040.00818.29
8.2.20.0040.00418.00
8.2.10.0030.00518.04
8.2.00.0040.00418.09
8.1.280.0100.01025.92
8.1.270.0050.00323.99
8.1.260.0110.00426.35
8.1.250.0050.00328.09
8.1.240.0030.01020.89
8.1.230.0040.00821.21
8.1.220.0040.00418.77
8.1.210.0060.00319.15
8.1.200.0060.00317.47
8.1.190.0030.00617.64
8.1.180.0030.00518.10
8.1.170.0030.00519.09
8.1.160.0080.00019.13
8.1.150.0070.00218.92
8.1.140.0040.00417.62
8.1.130.0000.00717.95
8.1.120.0040.00417.77
8.1.110.0050.00317.73
8.1.100.0040.00417.54
8.1.90.0040.00417.54
8.1.80.0040.00417.74
8.1.70.0030.00317.54
8.1.60.0040.00417.84
8.1.50.0040.00417.78
8.1.40.0060.00317.63
8.1.30.0000.00817.91
8.1.20.0030.00517.89
8.1.10.0040.00417.73
8.1.00.0000.00817.78
8.0.300.0030.00620.16
8.0.290.0000.00916.88
8.0.280.0000.00718.56
8.0.270.0040.00417.44
8.0.260.0030.00317.05
8.0.250.0040.00417.26
8.0.240.0050.00317.09
8.0.230.0030.00317.27
8.0.220.0030.00517.20
8.0.210.0040.00417.01
8.0.200.0080.00017.19
8.0.190.0000.00717.11
8.0.180.0050.00317.12
8.0.170.0030.00617.17
8.0.160.0030.00516.95
8.0.150.0040.00417.14
8.0.140.0070.00316.96
8.0.130.0030.00313.54
8.0.120.0060.00317.03
8.0.110.0040.00416.97
8.0.100.0020.00516.96
8.0.90.0000.00717.05
8.0.80.0060.00917.09
8.0.70.0030.00517.04
8.0.60.0040.00417.07
8.0.50.0070.00017.14
8.0.30.0130.00717.27
8.0.20.0160.01217.53
8.0.10.0040.00417.11
8.0.00.0130.01016.89
7.4.330.0000.00615.04
7.4.320.0000.00616.81
7.4.300.0030.00316.74
7.4.290.0080.00016.86
7.4.280.0080.00016.75
7.4.270.0030.00316.76
7.4.260.0030.00313.57
7.4.250.0000.00916.64
7.4.240.0040.00416.82
7.4.230.0030.00516.64
7.4.220.0110.00716.88
7.4.210.0110.00716.71
7.4.200.0040.00416.86
7.4.190.0070.00016.98
7.4.160.0030.01316.55
7.4.150.0120.00617.40
7.4.140.0130.00517.33
7.4.130.0150.00616.73
7.4.120.0150.00316.81
7.4.110.0040.01516.61
7.4.100.0170.00716.73
7.4.90.0090.00916.72
7.4.80.0140.00519.03
7.4.70.0070.01816.64
7.4.60.0110.01116.62
7.4.50.0030.00616.67
7.4.40.0040.01522.27
7.4.30.0080.00816.76
7.4.10.0100.00715.00
7.4.00.0120.00615.10
7.3.330.0000.00513.48
7.3.320.0050.00013.33
7.3.310.0040.00416.60
7.3.300.0030.00316.51
7.3.290.0040.01016.49
7.3.280.0080.01116.58
7.3.270.0110.00717.40
7.3.260.0090.01118.24
7.3.250.0080.01316.72
7.3.240.0160.00516.86
7.3.230.0090.01516.51
7.3.210.0110.00816.54
7.3.200.0070.01319.39
7.3.190.0150.00616.40
7.3.180.0120.00916.79
7.3.170.0000.01616.76
7.3.160.0040.01316.59
7.3.130.0070.00315.07
7.3.120.0050.01215.00
7.3.110.0140.00415.09
7.3.100.0030.00914.86
7.3.90.0000.01315.02
7.3.80.0130.00015.10
7.3.70.0060.00915.04
7.3.60.0000.00914.85
7.3.50.0030.01015.10
7.3.40.0060.00815.05
7.3.30.0070.00715.02
7.3.20.0030.00916.82
7.3.10.0070.00516.93
7.3.00.0050.00616.83
7.2.330.0090.00916.90
7.2.320.0100.00816.88
7.2.310.0070.01816.87
7.2.300.0100.01016.64
7.2.290.0070.01016.75
7.2.260.0120.00615.31
7.2.250.0030.01414.97
7.2.240.0000.01415.24
7.2.230.0000.01315.11
7.2.220.0070.00415.06
7.2.210.0070.01115.31
7.2.200.0040.01214.97
7.2.190.0060.00315.20
7.2.180.0040.00715.13
7.2.170.0160.00015.21
7.2.160.0100.00615.15
7.2.150.0060.00617.18
7.2.140.0060.00916.89
7.2.130.0050.00916.94
7.2.120.0060.00616.94
7.2.110.0020.01117.06
7.2.100.0090.00716.92
7.2.90.0070.00917.21
7.2.80.0080.00817.11
7.2.70.0050.00916.94
7.2.60.0050.00817.14
7.2.50.0060.00717.04
7.2.40.0060.00917.00
7.2.30.0090.00517.16
7.2.20.0060.00917.11
7.2.10.0060.00716.91
7.2.00.0070.00917.67
7.1.330.0100.00315.89
7.1.320.0030.01215.95
7.1.310.0090.00315.55
7.1.300.0080.00415.93
7.1.290.0060.00615.91
7.1.280.0030.01015.84
7.1.270.0070.00715.88
7.1.260.0140.00015.90
7.1.250.0090.00315.91
7.1.240.0080.00515.75
7.1.230.0040.00915.93
7.1.220.0020.01315.67
7.1.210.0050.00915.91
7.1.200.0090.00515.88
7.1.190.0030.00915.86
7.1.180.0030.00816.03
7.1.170.0120.00315.77
7.1.160.0050.01115.80
7.1.150.0070.00515.89
7.1.140.0060.00615.87
7.1.130.0060.00915.71
7.1.120.0030.01115.62
7.1.110.0060.00415.96
7.1.100.0040.01016.72
7.1.90.0050.01015.85
7.1.80.0040.00815.68
7.1.70.0070.00616.27
7.1.60.0070.01016.89
7.1.50.0070.00716.15
7.1.40.0070.00315.91
7.1.30.0050.00715.96
7.1.20.0080.00315.65
7.1.10.0040.01015.85
7.1.00.0040.02217.96
7.0.330.0030.00915.58
7.0.320.0040.00615.19
7.0.310.0000.01115.51
7.0.300.0050.00815.29
7.0.290.0020.01015.33
7.0.280.0070.00315.54
7.0.270.0060.00615.53
7.0.260.0060.00615.39
7.0.250.0020.01015.51
7.0.240.0040.00515.45
7.0.230.0020.01015.42
7.0.220.0040.00415.37
7.0.210.0050.00715.47
7.0.200.0110.00815.78
7.0.190.0040.00715.41
7.0.180.0100.00215.61
7.0.170.0070.00515.58
7.0.160.0010.01115.55
7.0.150.0050.00715.59
7.0.140.0050.02717.77
7.0.130.0050.00615.28
7.0.120.0070.00515.44
7.0.110.0080.00315.40
7.0.100.0090.00315.63
7.0.90.0010.01015.54
7.0.80.0050.00915.51
7.0.70.0050.00715.44
7.0.60.0160.02517.12
7.0.50.0070.02116.45
7.0.40.0070.02115.81
7.0.30.0070.01915.72
7.0.20.0050.02415.73
7.0.10.0040.03815.73
7.0.00.0070.02415.76
5.6.400.0030.01314.34
5.6.390.0000.01314.59
5.6.380.0070.00514.53
5.6.370.0060.00814.19
5.6.360.0070.00314.25
5.6.350.0060.00814.59
5.6.340.0100.00214.32
5.6.330.0090.00514.66
5.6.320.0040.00714.38
5.6.310.0040.00714.51
5.6.300.0070.00614.44
5.6.290.0110.00314.53
5.6.280.0030.03016.49
5.6.270.0070.00714.49
5.6.260.0030.01214.48
5.6.250.0040.01014.29
5.6.240.0040.00914.50
5.6.230.0070.00514.37
5.6.220.0050.00814.26
5.6.210.0050.02916.60
5.6.200.0040.02815.67
5.6.190.0060.03416.50
5.6.180.0100.02816.48
5.6.170.0070.02316.67
5.6.160.0060.02316.36
5.6.150.0060.03416.28
5.6.140.0080.01916.42
5.6.130.0070.03216.40
5.6.120.0070.01916.44
5.6.110.0090.02016.36
5.6.100.0060.03316.40
5.6.90.0080.02816.25
5.6.80.0060.02516.15
5.6.70.0050.01716.24
5.6.60.0040.02316.20
5.6.50.0050.02016.17
5.6.40.0030.03616.18
5.6.30.0060.03516.13
5.6.20.0020.03416.00
5.6.10.0040.03216.12
5.6.00.0090.01716.13
5.5.380.0070.00412.68
5.5.370.0070.00212.75
5.5.360.0030.01012.55
5.5.350.0030.01515.30
5.5.340.0070.02914.66
5.5.330.0050.03315.53
5.5.320.0080.02815.37
5.5.310.0040.01915.26
5.5.300.0080.02215.34
5.5.290.0060.01715.32
5.5.280.0040.02215.36
5.5.270.0040.02615.32
5.5.260.0030.02515.26
5.5.250.0040.02915.02
5.5.240.0040.02715.06
5.5.230.0030.01915.16
5.5.220.0050.03014.89
5.5.210.0100.02414.95
5.5.200.0040.02815.05
5.5.190.0040.01815.00
5.5.180.0050.01814.90
5.5.170.0030.00612.81
5.5.160.0030.01815.00
5.5.150.0060.02514.98
5.5.140.0050.02014.98
5.5.130.0010.02515.05
5.5.120.0070.02015.04
5.5.110.0030.01715.04
5.5.100.0090.01414.78
5.5.90.0070.02214.98
5.5.80.0050.01815.01
5.5.70.0060.02414.94
5.5.60.0040.02014.90
5.5.50.0080.02414.99
5.5.40.0080.01515.05
5.5.30.0060.01614.89
5.5.20.0060.01414.92
5.5.10.0030.01814.86
5.5.00.0070.02914.98
5.4.450.0040.02013.87
5.4.440.0020.02113.97
5.4.430.0070.02013.94
5.4.420.0060.02213.96
5.4.410.0030.01913.82
5.4.400.0060.02113.97
5.4.390.0010.01713.81
5.4.380.0040.01613.96
5.4.370.0030.01713.79
5.4.360.0080.01413.86
5.4.350.0020.02913.72
5.4.340.0060.01913.97
5.4.330.0020.00711.10
5.4.320.0080.01913.84
5.4.310.0080.02413.86
5.4.300.0050.01613.91
5.4.290.0040.02513.88
5.4.280.0040.01513.72
5.4.270.0020.02313.79
5.4.260.0080.01413.79
5.4.250.0050.02613.90
5.4.240.0030.02013.63
5.4.230.0050.01713.81
5.4.220.0050.01913.82
5.4.210.0010.01813.68
5.4.200.0100.02613.75
5.4.190.0040.02113.80
5.4.180.0020.01713.85
5.4.170.0070.02513.84
5.4.160.0050.03113.81
5.4.150.0110.01613.82
5.4.140.0060.01313.06
5.4.130.0030.01612.92
5.4.120.0040.02012.86
5.4.110.0050.01912.90
5.4.100.0040.01812.81
5.4.90.0020.01912.87
5.4.80.0050.02612.86
5.4.70.0040.02812.96
5.4.60.0090.02112.92
5.4.50.0060.01512.87
5.4.40.0070.02712.97
5.4.30.0020.03113.00
5.4.20.0030.02812.98
5.4.10.0040.02312.83
5.4.00.0080.01812.68
5.3.290.0010.03412.08
5.3.280.0070.01411.93
5.3.270.0020.01711.87
5.3.260.0050.02712.04
5.3.250.0030.01812.06
5.3.240.0030.01512.00
5.3.230.0060.02812.04
5.3.220.0030.03011.95
5.3.210.0030.03211.91
5.3.200.0050.02011.95
5.3.190.0030.01911.97
5.3.180.0060.01512.07
5.3.170.0060.02112.03
5.3.160.0060.01711.97
5.3.150.0040.02111.88
5.3.140.0040.01712.02
5.3.130.0070.02112.02
5.3.120.0070.02711.96
5.3.110.0020.03511.95
5.3.100.0070.02711.90
5.3.90.0070.01911.88
5.3.80.0040.01911.79
5.3.70.0060.02811.76
5.3.60.0080.02211.79
5.3.50.0020.02911.68
5.3.40.0070.02511.63
5.3.30.0040.02511.67
5.3.20.0030.02111.73
5.3.10.0040.02211.61
5.3.00.0060.02911.57
5.2.170.0050.02710.80
5.2.160.0070.02510.73
5.2.150.0050.01810.78
5.2.140.0050.02210.81
5.2.130.0030.02510.68
5.2.120.0020.02410.79
5.2.110.0020.03310.76
5.2.100.0060.01310.80
5.2.90.0030.03510.78
5.2.80.0000.02110.68
5.2.70.0030.03510.73
5.2.60.0030.01610.68
5.2.50.0020.02410.75
5.2.40.0070.02910.69
5.2.30.0050.03010.70
5.2.20.0010.02110.68
5.2.10.0070.02910.63
5.2.00.0020.03010.56
5.1.60.0040.02510.24
5.1.50.0050.02010.18
5.1.40.0030.01710.19
5.1.30.0050.02910.37
5.1.20.0030.02510.38
5.1.10.0060.02810.23
5.1.00.0030.02010.16
5.0.50.0070.0159.48
5.0.40.0030.0199.40
5.0.30.0020.0299.29
5.0.20.0020.0119.30
5.0.10.0040.0239.29
5.0.00.0040.0209.23
4.4.90.0030.0108.46
4.4.80.0000.0138.46
4.4.70.0020.0138.46
4.4.60.0000.0158.46
4.4.50.0030.0188.46
4.4.40.0000.0278.46
4.4.30.0050.0108.46
4.4.20.0000.0218.46
4.4.10.0000.0208.46
4.4.00.0010.0258.46
4.3.110.0000.0218.46
4.3.100.0020.0108.46
4.3.90.0010.0088.46
4.3.80.0020.0168.46
4.3.70.0000.0108.46
4.3.60.0020.0188.46
4.3.50.0020.0088.46
4.3.40.0050.0268.46
4.3.30.0000.0108.46
4.3.20.0000.0108.46
4.3.10.0000.0198.46
4.3.00.0020.0138.46

preferences:
38.8 ms | 401 KiB | 5 Q