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>'. ' <row3 ver="3.0">'. ' <test>data</test>'. ' </row3>'. ' </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('row3'));

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.0090.00916.75
8.3.50.0130.00422.24
8.3.40.0040.01118.79
8.3.30.0110.00319.29
8.3.20.0070.00020.34
8.3.10.0050.00523.87
8.3.00.0080.00020.96
8.2.180.0120.00318.91
8.2.170.0100.01022.96
8.2.160.0160.00420.66
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0080.00022.46
8.2.110.0000.01019.57
8.2.100.0060.00618.16
8.2.90.0000.00818.00
8.2.80.0070.00417.97
8.2.70.0000.00818.16
8.2.60.0040.00418.18
8.2.50.0060.00318.10
8.2.40.0000.00922.40
8.2.30.0040.00418.49
8.2.20.0040.00417.82
8.2.10.0050.00218.35
8.2.00.0020.00518.05
8.1.280.0130.00725.92
8.1.270.0080.00024.10
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0050.00524.03
8.1.230.0040.00822.88
8.1.220.0030.00518.04
8.1.210.0030.00518.77
8.1.200.0080.00017.48
8.1.190.0080.00017.48
8.1.180.0000.00918.10
8.1.170.0030.00718.77
8.1.160.0040.00422.22
8.1.150.0000.00718.84
8.1.140.0040.00417.69
8.1.130.0040.00418.07
8.1.120.0070.00017.61
8.1.110.0030.00617.59
8.1.100.0040.00417.62
8.1.90.0040.00417.70
8.1.80.0040.00417.73
8.1.70.0000.00717.66
8.1.60.0000.01217.71
8.1.50.0000.00917.56
8.1.40.0060.00317.71
8.1.30.0000.00917.96
8.1.20.0050.00317.91
8.1.10.0000.00817.68
8.1.00.0060.00317.79
8.0.300.0040.00420.28
8.0.290.0000.00816.88
8.0.280.0000.00818.68
8.0.270.0040.00417.39
8.0.260.0000.00817.40
8.0.250.0070.00017.12
8.0.240.0080.00017.23
8.0.230.0070.00017.14
8.0.220.0070.00017.15
8.0.210.0000.00717.05
8.0.200.0000.00717.08
8.0.190.0080.00017.25
8.0.180.0000.00717.23
8.0.170.0050.00217.21
8.0.160.0040.00417.00
8.0.150.0060.00317.10
8.0.140.0080.00017.14
8.0.130.0050.00013.45
8.0.120.0080.00016.99
8.0.110.0000.00717.01
8.0.100.0030.00617.13
8.0.90.0040.00417.16
8.0.80.0060.00917.14
8.0.70.0050.00317.03
8.0.60.0040.00416.87
8.0.50.0080.00017.09
8.0.30.0100.00817.41
8.0.20.0130.01017.45
8.0.10.0080.00017.26
8.0.00.0080.00917.21
7.4.330.0030.00315.25
7.4.320.0070.00016.85
7.4.300.0030.00316.84
7.4.290.0030.00316.74
7.4.280.0070.00316.75
7.4.270.0070.00016.85
7.4.260.0030.00516.82
7.4.250.0040.00416.88
7.4.240.0040.00416.84
7.4.230.0040.00416.84
7.4.220.0060.01316.89
7.4.210.0050.00916.79
7.4.200.0000.00716.80
7.4.190.0000.00816.69
7.4.160.0100.00716.77
7.4.150.0150.00417.40
7.4.140.0090.00917.86
7.4.130.0080.00816.81
7.4.120.0100.00716.67
7.4.110.0140.00816.68
7.4.100.0060.01616.75
7.4.90.0140.00416.87
7.4.80.0060.01219.39
7.4.70.0120.00916.88
7.4.60.0070.01116.70
7.4.50.0050.00016.89
7.4.40.0090.00916.75
7.4.30.0090.00816.77
7.4.00.0070.00415.06
7.3.330.0000.00513.46
7.3.320.0050.00013.57
7.3.310.0070.00016.39
7.3.300.0070.00016.51
7.3.290.0030.01016.58
7.3.280.0100.00816.55
7.3.270.0140.01117.40
7.3.260.0120.00616.82
7.3.250.0080.00916.57
7.3.240.0100.00716.69
7.3.230.0040.01316.61
7.3.210.0100.01016.61
7.3.200.0130.00319.39
7.3.190.0110.01116.87
7.3.180.0060.01216.79
7.3.170.0090.00916.59
7.3.160.0060.01016.57
7.3.120.0030.01315.08
7.2.330.0080.00917.06
7.2.320.0080.00916.66
7.2.310.0080.00816.96
7.2.300.0030.01616.77
7.2.290.0060.01016.93
7.2.00.0030.01319.54
7.1.200.0000.01115.98
7.1.100.0140.00418.23
7.1.70.0060.00317.39
7.1.60.0100.01419.46
7.1.50.0130.01016.85
7.1.00.0030.07322.53
7.0.200.0030.00516.77
7.0.140.0030.07322.13
7.0.110.0070.03320.04
7.0.100.0070.03320.13
7.0.90.0470.02320.13
7.0.80.0070.03720.09
7.0.70.0170.04320.09
7.0.60.0130.03020.02
7.0.50.0000.04020.04
7.0.40.0130.03019.91
7.0.30.0030.03719.79
7.0.20.0130.03319.84
7.0.10.0100.03319.85
7.0.00.0000.04719.84
5.6.280.0000.07721.17
5.6.260.0070.03720.71
5.6.250.0100.02720.70
5.6.240.0030.03720.76
5.6.230.0000.04020.71
5.6.220.0000.03720.72
5.6.210.0000.03720.61
5.6.200.0100.03320.72
5.6.190.0000.05720.70
5.6.180.0070.03720.68
5.6.170.0030.03320.91
5.6.160.0000.03720.72
5.6.150.0070.03320.76
5.6.140.0000.04020.90
5.6.130.0030.04020.68
5.6.120.0000.04720.70
5.6.110.0170.04320.74
5.6.100.0000.04720.70
5.6.90.0030.05020.63
5.6.80.0030.03320.08
5.6.70.0070.03320.04
5.6.60.0100.03720.28
5.6.50.0100.03020.20
5.6.40.0070.03720.27
5.6.30.0070.05720.12
5.6.20.0100.03020.17
5.6.10.0070.03720.02
5.6.00.0030.05320.03
5.5.380.0000.03717.74
5.5.370.0070.03017.77
5.5.360.0000.03717.64
5.5.350.0000.03717.91
5.5.340.0000.03718.00
5.5.330.0030.03318.31
5.5.320.0100.04018.05
5.5.310.0000.03718.45
5.5.300.0070.03018.45
5.5.290.0030.04317.91
5.5.280.0030.05018.16
5.5.270.0030.04017.92
5.5.260.0000.04018.44
5.5.250.0030.03718.09
5.5.240.0070.03017.42
5.5.230.0070.03017.83
5.5.220.0070.03317.67
5.5.210.0030.05017.43
5.5.200.0070.05717.38
5.5.190.0070.03317.52
5.5.180.0000.04317.34
5.5.160.0030.06017.60
5.5.150.0130.03017.62
5.5.140.0030.04017.80
5.5.130.0030.03717.47
5.5.120.0000.03717.35
5.5.110.0070.03317.38
5.5.100.0130.04717.40
5.5.90.0030.05717.25
5.5.80.0030.03717.52
5.5.70.0100.07717.40
5.5.60.0030.04017.54
5.5.50.0000.05317.36
5.5.40.0100.03717.54
5.5.30.0100.03717.61
5.5.20.0030.03717.60
5.5.10.0070.04717.26
5.5.00.0000.04017.36
5.4.450.0000.03719.73
5.4.440.0130.06719.41
5.4.430.0030.05019.60
5.4.420.0030.04019.71
5.4.410.0070.03019.47
5.4.400.0100.02719.16
5.4.390.0030.03319.07
5.4.380.0030.03019.08
5.4.370.0070.03319.09
5.4.360.0100.04319.38
5.4.350.0100.04319.45
5.4.340.0030.04019.41
5.4.320.0030.04319.37
5.4.310.0070.03319.22
5.4.300.0030.05019.10
5.4.290.0070.03319.38
5.4.280.0100.03719.07
5.4.270.0000.03719.21
5.4.260.0070.03319.36
5.4.250.0100.03319.37
5.4.240.0100.03019.07
5.4.230.0000.06719.16
5.4.220.0000.04319.10
5.4.210.0030.03719.16
5.4.200.0030.03719.25
5.4.190.0070.05319.37
5.4.180.0070.03019.21
5.4.170.0030.03319.20
5.4.160.0130.07319.13
5.4.150.0030.03719.08
5.4.140.0070.03316.78
5.4.130.0030.03716.53
5.4.120.0030.05316.68
5.4.110.0030.04016.57
5.4.100.0030.03716.74
5.4.90.0000.03716.63
5.4.80.0030.03716.73
5.4.70.0130.02716.62
5.4.60.0000.04016.75
5.4.50.0030.03716.73
5.4.40.0030.03016.75
5.4.30.0030.03016.72
5.4.20.0070.02716.61
5.4.10.0030.03016.77
5.4.00.0030.03016.31
5.3.290.0000.07714.83
5.3.280.0000.04314.77
5.3.270.0070.03314.71
5.3.260.0070.03314.80
5.3.250.0030.03314.91
5.3.240.0030.03714.83
5.3.230.0100.05314.79
5.3.220.0030.04014.77
5.3.210.0000.03314.66
5.3.200.0030.04014.75
5.3.190.0000.04014.79
5.3.180.0030.04014.73
5.3.170.0070.02714.78
5.3.160.0030.03314.73
5.3.150.0000.03314.79
5.3.140.0030.03014.65
5.3.130.0070.03314.71
5.3.120.0030.03714.66
5.3.110.0070.02714.66
5.3.100.0030.03014.13
5.3.90.0000.03314.29
5.3.80.0000.04014.23
5.3.70.0030.03714.21
5.3.60.0000.03714.09
5.3.50.0070.03014.13
5.3.40.0000.03714.12
5.3.30.0030.03014.11
5.3.20.0070.03013.88
5.3.10.0000.03313.77
5.3.00.0000.03713.95
5.2.170.0000.03712.11
5.2.160.0000.02712.11
5.2.150.0030.03312.11
5.2.140.0100.02312.11
5.2.130.0070.02012.11
5.2.120.0030.02712.11
5.2.110.0000.02712.11
5.2.100.0030.02712.11
5.2.90.0030.02712.11
5.2.80.0070.02312.11
5.2.70.0100.02012.11
5.2.60.0000.03012.11
5.2.50.0100.02012.11
5.2.40.0000.02712.11
5.2.30.0030.02712.11
5.2.20.0070.02012.11
5.2.10.0030.05012.11
5.2.00.0070.02312.11
5.1.60.0000.02712.11
5.1.50.0030.02312.11
5.1.40.0000.02712.11
5.1.30.0030.02312.11
5.1.20.0000.02712.11
5.1.10.0030.02312.11
5.1.00.0100.03012.11
5.0.50.0000.02712.11
5.0.40.0030.01312.11
5.0.30.0030.03012.11
5.0.20.0030.01712.11
5.0.10.0070.01712.11
5.0.00.0070.03712.11
4.4.90.0030.01012.11
4.4.80.0000.02712.11
4.4.70.0030.01312.11
4.4.60.0000.02012.11
4.4.50.0000.01312.11
4.4.40.0030.03312.11
4.4.30.0000.02012.11
4.4.20.0030.01012.11
4.4.10.0000.02312.11
4.4.00.0000.02312.11
4.3.110.0030.01312.11
4.3.100.0030.01012.11
4.3.90.0030.01312.11
4.3.80.0000.02712.11
4.3.70.0000.01312.11
4.3.60.0000.01312.11
4.3.50.0030.01312.11
4.3.40.0000.02712.11
4.3.30.0030.01012.11
4.3.20.0000.01312.11
4.3.10.0000.01712.11
4.3.00.0070.01312.11

preferences:
52.53 ms | 401 KiB | 5 Q