3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.00.0000.01519.46
7.1.100.0090.00618.31
7.1.70.0030.00717.29
7.1.60.0090.01619.40
7.1.50.0060.01617.14
7.1.00.0000.03722.43
7.0.200.0630.01014.68
7.0.140.0070.07022.19
7.0.120.0070.05322.16
7.0.60.0100.07020.04
7.0.50.0100.08018.07
7.0.40.0070.05720.40
7.0.30.0370.07020.40
7.0.20.0230.05020.41
7.0.10.0130.06020.32
7.0.00.0000.04720.28
5.6.280.0070.07021.07
5.6.210.0130.06020.72
5.6.200.0030.07718.36
5.6.190.0130.08720.55
5.6.180.3200.04320.53
5.6.170.0370.07320.63
5.6.160.0030.09020.63
5.6.150.0100.03318.29
5.6.140.0070.04718.31
5.6.130.0070.04018.36
5.6.120.0100.04721.11
5.6.110.0030.08721.01
5.6.100.0130.08021.20
5.6.90.0070.08721.12
5.6.80.0070.07320.43
5.5.350.0030.08020.51
5.5.340.0100.07718.11
5.5.330.0100.08720.63
5.5.320.0270.06320.42
5.5.310.0270.08320.50
5.5.300.0100.07318.15
5.5.290.0000.06718.05
5.5.280.0100.08020.93
5.5.270.0070.06320.98
5.5.260.0030.08321.10
5.5.250.0070.04020.80
5.5.240.4130.03020.38
5.4.450.0230.06719.54
5.4.440.0070.06319.25
5.4.430.0130.05019.38
5.4.420.0070.07019.51
5.4.410.0070.07019.64
5.4.400.0100.06318.95
5.4.390.0030.05719.45
5.4.380.0070.06719.15
5.4.370.0070.06019.06
5.4.360.0070.07319.44
5.4.350.0130.07319.05
5.4.340.0130.06019.19
5.4.320.0070.08318.93
5.4.310.0100.06719.19
5.4.300.0100.05719.05
5.4.290.0000.07018.92
5.4.280.0130.07319.06
5.4.270.0030.07019.05
5.4.260.0070.08019.37
5.4.250.0100.05319.28
5.4.240.0030.04319.28
5.4.230.0070.04019.37
5.4.220.0030.06719.27
5.4.210.0000.08019.34
5.4.200.0030.07019.43
5.4.190.0070.05019.05
5.4.180.0030.04318.95
5.4.170.0070.04018.91
5.4.160.0070.04719.35
5.4.150.0030.04319.36
5.4.140.0170.06316.44
5.4.130.0100.06716.59
5.4.120.0070.06016.41
5.4.110.0100.03316.52
5.4.100.0070.07016.80
5.4.90.0000.07716.38
5.4.80.0030.06016.70
5.4.70.0100.05016.53
5.4.60.0130.03016.53
5.4.50.0100.03716.59
5.4.40.0030.03716.53
5.4.30.0000.03716.53
5.4.20.0030.04016.55
5.4.10.0000.03716.52
5.4.00.0070.03016.00
5.3.290.0070.07314.82
5.3.280.0070.08014.83
5.3.270.0030.04314.71
5.3.260.0000.04014.73
5.3.250.0070.07314.75
5.3.240.0170.06314.61
5.3.230.0100.07014.76
5.3.220.0000.08014.81
5.3.210.0070.06314.77
5.3.200.0030.05314.57
5.3.190.0070.07014.78
5.3.180.0100.07314.67
5.3.170.0100.04714.77
5.3.160.0000.04014.68
5.3.150.0000.08014.79
5.3.140.0030.04714.70
5.3.130.0070.03314.75
5.3.120.0030.03714.67
5.3.110.0000.04014.69
5.3.100.0000.04014.25
5.3.90.0030.03714.14
5.3.80.0030.04014.13
5.3.70.0030.04014.27
5.3.60.0030.03714.11
5.3.50.0000.03713.96
5.3.40.0070.03314.11
5.3.30.0070.04014.15
5.3.20.0030.03313.83
5.3.10.0030.03313.90
5.3.00.0030.03313.79
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