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 inherit="yes">data</test>'. ' </row3>'. ' </rows>'. ' </body>'. '</request>'; $obj = new MyXML($s); $rows = $obj->firstChild()->firstChild()->row3; 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.0100.01018.68
8.3.50.0110.00522.22
8.3.40.0150.00618.77
8.3.30.0090.00619.29
8.3.20.0000.00820.49
8.3.10.0080.00022.30
8.3.00.0000.00822.57
8.2.180.0130.00316.61
8.2.170.0000.01522.96
8.2.160.0000.01520.99
8.2.150.0040.00424.18
8.2.140.0100.00624.66
8.2.130.0040.00426.16
8.2.120.0060.00319.61
8.2.110.0000.00922.36
8.2.100.0080.00417.81
8.2.90.0040.00419.29
8.2.80.0080.00018.05
8.2.70.0070.00317.75
8.2.60.0060.00318.05
8.2.50.0040.00418.07
8.2.40.0100.00318.27
8.2.30.0030.00718.38
8.2.20.0030.00517.84
8.2.10.0000.00817.93
8.2.00.0030.00617.84
8.1.280.0170.00325.92
8.1.270.0000.00724.06
8.1.260.0080.00026.35
8.1.250.0140.00628.09
8.1.240.0000.00923.95
8.1.230.0080.00419.39
8.1.220.0050.00317.91
8.1.210.0040.00418.77
8.1.200.0070.00317.60
8.1.190.0060.00317.64
8.1.180.0040.00418.10
8.1.170.0060.00318.77
8.1.160.0000.00722.22
8.1.150.0040.00418.87
8.1.140.0000.00717.53
8.1.130.0030.00318.01
8.1.120.0030.00417.65
8.1.110.0080.00017.54
8.1.100.0040.00417.58
8.1.90.0040.00417.55
8.1.80.0040.00417.55
8.1.70.0030.00517.72
8.1.60.0060.00317.90
8.1.50.0040.00417.81
8.1.40.0000.00817.84
8.1.30.0030.00617.78
8.1.20.0050.00317.84
8.1.10.0080.00017.71
8.1.00.0040.00417.82
8.0.300.0070.00018.77
8.0.290.0060.00317.28
8.0.280.0050.00318.64
8.0.270.0000.00717.37
8.0.260.0070.00017.05
8.0.250.0070.00017.06
8.0.240.0000.00717.25
8.0.230.0040.00417.05
8.0.220.0030.00317.16
8.0.210.0000.00816.99
8.0.200.0030.00317.26
8.0.190.0040.00317.21
8.0.180.0030.00517.17
8.0.170.0030.00517.11
8.0.160.0070.00017.13
8.0.150.0040.00417.09
8.0.140.0000.00717.14
8.0.130.0000.00613.52
8.0.120.0070.00317.10
8.0.110.0040.00417.07
8.0.100.0000.00817.16
8.0.90.0040.00417.03
8.0.80.0130.00317.14
8.0.70.0040.00417.05
8.0.60.0000.00817.07
8.0.50.0070.00017.01
8.0.30.0130.00817.21
8.0.20.0080.01017.42
8.0.10.0040.00417.27
8.0.00.0120.00616.98
7.4.330.0050.00015.37
7.4.320.0050.00216.66
7.4.300.0030.00316.74
7.4.290.0000.00716.72
7.4.280.0030.00316.62
7.4.270.0000.00816.68
7.4.260.0030.00316.82
7.4.250.0030.00516.77
7.4.240.0060.00216.77
7.4.230.0000.00716.62
7.4.220.0160.00016.76
7.4.210.0050.00816.79
7.4.200.0030.00316.56
7.4.190.0070.00016.78
7.4.160.0150.00616.79
7.4.150.0110.00617.40
7.4.140.0140.00817.86
7.4.130.0120.00516.76
7.4.120.0090.01216.82
7.4.110.0100.01316.70
7.4.100.0100.00716.73
7.4.90.0000.01816.79
7.4.80.0090.00919.39
7.4.70.0110.00716.65
7.4.60.0070.01016.88
7.4.50.0030.00316.46
7.4.40.0060.00922.77
7.4.30.0150.00316.77
7.4.00.0110.00615.10
7.3.330.0050.00013.32
7.3.320.0030.00313.25
7.3.310.0030.00316.54
7.3.300.0040.00416.44
7.3.290.0060.01316.51
7.3.280.0100.00816.52
7.3.270.0120.00617.40
7.3.260.0120.00616.94
7.3.250.0150.00316.81
7.3.240.0060.01216.96
7.3.230.0140.00416.82
7.3.210.0070.01616.86
7.3.200.0160.00619.39
7.3.190.0110.01116.61
7.3.180.0080.01216.56
7.3.170.0090.00616.85
7.3.160.0100.00716.79
7.3.120.0100.00815.15
7.3.110.0050.01015.15
7.3.100.0060.00915.26
7.3.90.0060.00515.08
7.3.80.0030.00914.86
7.3.70.0080.00514.97
7.3.60.0060.00815.06
7.3.50.0060.00514.73
7.3.40.0020.01114.95
7.3.30.0030.01014.86
7.3.20.0110.00516.71
7.3.10.0070.00816.58
7.3.00.0050.01016.64
7.2.330.0110.00616.71
7.2.320.0140.00416.99
7.2.310.0090.00916.89
7.2.300.0140.00417.00
7.2.290.0110.00717.00
7.2.250.0080.01015.23
7.2.240.0150.00315.32
7.2.230.0080.00815.13
7.2.220.0030.00715.26
7.2.210.0060.01115.20
7.2.200.0080.00515.15
7.2.190.0100.00214.97
7.2.180.0060.00715.31
7.2.170.0070.00715.17
7.2.130.0110.00516.98
7.2.120.0140.00217.02
7.2.110.0110.00616.91
7.2.100.0100.00516.95
7.2.90.0090.00516.92
7.2.80.0100.00716.93
7.2.70.0070.00816.94
7.2.60.0060.00917.09
7.2.50.0080.00816.97
7.2.40.0100.00317.11
7.2.30.0080.00817.11
7.2.20.0090.00617.13
7.2.10.0070.00917.01
7.2.00.0060.00917.83
7.1.330.0040.01215.87
7.1.320.0050.00616.08
7.1.310.0080.00515.84
7.1.300.0080.00815.88
7.1.290.0050.01015.63
7.1.280.0070.00815.98
7.1.270.0090.00515.85
7.1.260.0060.00515.73
7.1.250.0040.01015.66
7.1.240.0100.00815.67
7.1.230.0100.00615.83
7.1.220.0080.00615.55
7.1.210.0050.00815.69
7.1.200.0050.00815.75
7.1.190.0050.00915.71
7.1.180.0080.00615.69
7.1.170.0030.01215.64
7.1.160.0110.00515.88
7.1.150.0110.00216.00
7.1.140.0080.00915.92
7.1.130.0070.00615.90
7.1.120.0080.00615.80
7.1.110.0080.00515.74
7.1.100.0140.00716.59
7.1.90.0080.00915.76
7.1.80.0130.00315.75
7.1.70.0080.00716.05
7.1.60.0110.00717.12
7.1.50.0070.01016.27
7.1.40.0090.00715.69
7.1.30.0050.00815.80
7.1.20.0090.00415.81
7.1.10.0090.00915.71
7.1.00.0060.03218.08
7.0.330.0090.00915.46
7.0.320.0070.01115.24
7.0.310.0110.00715.39
7.0.300.0150.00315.28
7.0.290.0040.01215.43
7.0.280.0060.00915.29
7.0.270.0050.01015.44
7.0.260.0110.00215.37
7.0.250.0080.00715.32
7.0.240.0060.01015.43
7.0.230.0070.00715.49
7.0.220.0100.00615.48
7.0.210.0110.00615.48
7.0.200.0060.01015.95
7.0.190.0140.00315.31
7.0.180.0140.00515.48
7.0.170.0080.00815.41
7.0.160.0100.01115.45
7.0.150.0110.00715.50
7.0.140.0050.03217.71
7.0.130.0060.00815.45
7.0.120.0100.00515.19
7.0.110.0110.00715.18
7.0.100.0080.00515.31
7.0.90.0070.01015.35
7.0.80.0090.00615.22
7.0.70.0060.03516.87
7.0.60.0070.03616.92
7.0.50.0130.02017.19
7.0.40.0060.03815.73
7.0.30.0060.03615.61
7.0.20.0060.02815.68
7.0.10.0070.03415.80
7.0.00.0130.02615.63
5.6.380.0060.00814.16
5.6.370.0100.00914.29
5.6.360.0120.00814.13
5.6.350.0110.00914.43
5.6.340.0120.00814.37
5.6.330.0110.00814.18
5.6.320.0100.00514.51
5.6.310.0130.00514.43
5.6.300.0060.01114.47
5.6.290.0060.01214.42
5.6.280.0110.02416.60
5.6.270.0090.00814.55
5.6.260.0030.01414.27
5.6.250.0100.00714.30
5.6.240.0090.00514.45
5.6.230.0040.01214.35
5.6.220.0070.03516.42
5.6.210.0060.02216.55
5.6.200.0080.01916.65
5.6.190.0060.03416.58
5.6.180.0070.03516.55
5.6.170.0050.02616.72
5.6.160.0080.03216.50
5.6.150.0100.03016.53
5.6.140.0080.03016.63
5.6.130.0050.02716.55
5.6.120.0110.01816.59
5.6.110.0090.03116.67
5.6.100.0070.03616.68
5.6.90.0080.02316.57
5.6.80.0080.03016.47
5.6.70.0100.02316.30
5.6.60.0060.02516.36
5.6.50.0090.03216.25
5.6.40.0060.03416.40
5.6.30.0130.02616.37
5.6.20.0100.02516.28
5.6.10.0070.02016.35
5.6.00.0080.02816.37
5.5.380.0060.00611.18
5.5.370.0060.00511.46
5.5.360.0040.01914.30
5.5.350.0020.03714.35
5.5.340.0030.02214.52
5.5.330.0040.02414.24
5.5.320.0070.02714.53
5.5.310.0070.02814.57
5.5.300.0080.03014.42
5.5.290.0060.02214.52
5.5.280.0060.03114.50
5.5.270.0020.03314.60
5.5.260.0080.03014.51
5.5.250.0080.01914.31
5.5.240.0050.03214.28
5.5.230.0050.03314.22
5.5.220.0070.01614.24
5.5.210.0130.02414.22
5.5.200.0040.03214.18
5.5.190.0080.02814.17
5.5.180.0090.02314.25
5.5.170.0080.00511.12
5.5.160.0070.02814.13
5.5.150.0080.02614.23
5.5.140.0060.02814.25
5.5.130.0080.02714.11
5.5.120.0060.02214.11
5.5.110.0090.02214.04
5.5.100.0060.03214.21
5.5.90.0040.03314.15
5.5.80.0130.02514.13
5.5.70.0040.02814.15
5.5.60.0040.02214.05
5.5.50.0060.01814.24
5.5.40.0050.03414.17
5.5.30.0010.03114.21
5.5.20.0060.02214.17
5.5.10.0030.03114.08
5.5.00.0090.02814.12
5.4.450.0080.02714.08
5.4.440.0030.02614.06
5.4.430.0070.03213.99
5.4.420.0090.02013.88
5.4.410.0060.03113.74
5.4.400.0090.02713.80
5.4.390.0060.03113.65
5.4.380.0110.02713.63
5.4.370.0070.03113.83
5.4.360.0120.02013.56
5.4.350.0090.02313.67
5.4.340.0060.02813.81
5.4.330.0050.01011.06
5.4.320.0040.03213.75
5.4.310.0020.03413.89
5.4.300.0080.02813.72
5.4.290.0030.03013.56
5.4.280.0040.03013.72
5.4.270.0050.03113.81
5.4.260.0060.02813.75
5.4.250.0060.02813.74
5.4.240.0040.03213.67
5.4.230.0030.03013.66
5.4.220.0060.03013.87
5.4.210.0030.02213.77
5.4.200.0020.03013.90
5.4.190.0060.02613.75
5.4.180.0020.02213.80
5.4.170.0060.02813.69
5.4.160.0050.01613.59
5.4.150.0040.02013.73
5.4.140.0080.01912.88
5.4.130.0090.01312.90
5.4.120.0050.02112.76
5.4.110.0070.02712.86
5.4.100.0030.02212.79
5.4.90.0040.01513.03
5.4.80.0040.02912.70
5.4.70.0040.02012.89
5.4.60.0030.02012.88
5.4.50.0050.01812.81
5.4.40.0070.02612.98
5.4.30.0100.02712.93
5.4.20.0060.01612.99
5.4.10.0050.02912.81
5.4.00.0060.02012.77
5.3.290.0060.02912.17
5.3.280.0020.03012.00
5.3.270.0130.02611.98
5.3.260.0060.02811.99
5.3.250.0090.01912.03
5.3.240.0000.02211.88
5.3.230.0050.02012.03
5.3.220.0040.03211.89
5.3.210.0040.02011.87
5.3.200.0050.01811.87
5.3.190.0040.01611.90
5.3.180.0070.02112.03
5.3.170.0030.02711.94
5.3.160.0050.01711.99
5.3.150.0080.02611.97
5.3.140.0080.01711.96
5.3.130.0080.01712.03
5.3.120.0060.02011.90
5.3.110.0090.02612.04
5.3.100.0030.03411.78
5.3.90.0070.02511.80
5.3.80.0090.02011.84
5.3.70.0060.03111.75
5.3.60.0050.02311.74
5.3.50.0070.02911.79
5.3.40.0040.01911.72
5.3.30.0060.02711.74
5.3.20.0090.01711.79
5.3.10.0050.02811.60
5.3.00.0020.03011.54
5.2.170.0090.02210.63
5.2.160.0020.02910.70
5.2.150.0060.02510.68
5.2.140.0060.02010.69
5.2.130.0060.02310.68
5.2.120.0060.01410.61
5.2.110.0100.02210.69
5.2.100.0060.01410.62
5.2.90.0040.01610.68
5.2.80.0030.02910.58
5.2.70.0050.01610.60
5.2.60.0020.02510.64
5.2.50.0040.02410.66
5.2.40.0040.02410.66
5.2.30.0060.02310.62
5.2.20.0080.01410.63
5.2.10.0040.02310.59
5.2.00.0050.02310.60
5.1.60.0070.01810.58
5.1.50.0040.02210.58
5.1.40.0030.02210.58
5.1.30.0050.02110.58
5.1.20.0060.01810.58
5.1.10.0060.01710.58
5.1.00.0040.01910.58
5.0.50.0020.01910.58
5.0.40.0040.01710.58
5.0.30.0030.02510.58
5.0.20.0030.01810.58
5.0.10.0060.01710.58
5.0.00.0050.02210.58
4.4.90.0050.00810.58
4.4.80.0030.01110.58
4.4.70.0020.01510.58
4.4.60.0040.01210.58
4.4.50.0020.01110.58
4.4.40.0000.02410.58
4.4.30.0010.01510.58
4.4.20.0020.01410.58
4.4.10.0040.01010.58
4.4.00.0030.02110.58
4.3.110.0020.01610.58
4.3.100.0040.01410.58
4.3.90.0030.01310.58
4.3.80.0040.01810.58
4.3.70.0020.01110.58
4.3.60.0040.01410.58
4.3.50.0030.01210.58
4.3.40.0030.01910.58
4.3.30.0010.01310.58
4.3.20.0030.01310.58
4.3.10.0020.01310.58
4.3.00.0010.01210.58

preferences:
46.55 ms | 400 KiB | 5 Q