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()); } public function nodeIsCollection() { return count($this); } public function getChildrenKeys() { $all = []; $children = $this->children(); foreach ($children as $key => $child) { if (!in_array($key, $all)) $all[] = $key; } return $all; } public function getValue() { return (string)$this; } public function hasValue() { } } $s = '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>'. '<request>'. ' <body>'. ' <rows>'. ' <row0 />'. ' <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>'. ' <row4 ver="4.0">my test data</row4>'. ' </rows>'. ' </body>'. '</request>'; $obj = new MyXML($s); $row = $obj->firstChild()->firstChild()->row0; var_dump($row->attributes());

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.0070.00719.09
8.3.30.0150.00418.92
8.3.20.0030.00618.98
8.3.10.0090.00020.78
8.3.00.0030.00619.38
8.2.170.0030.01622.96
8.2.160.0070.00719.12
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0130.00026.16
8.2.120.0030.00619.16
8.2.110.0090.00021.30
8.2.100.0090.01117.78
8.2.90.0090.00019.64
8.2.80.0040.00419.51
8.2.70.0050.00317.88
8.2.60.0040.00418.18
8.2.50.0080.00319.47
8.2.40.0000.00818.47
8.2.30.0000.00718.28
8.2.20.0030.00817.87
8.2.10.0000.00818.00
8.2.00.0040.00417.89
8.1.270.0000.00923.99
8.1.260.0110.00326.35
8.1.250.0100.00728.09
8.1.240.0030.00622.67
8.1.230.0040.00721.14
8.1.220.0040.00418.05
8.1.210.0030.00519.16
8.1.200.0070.00317.48
8.1.190.0000.00917.66
8.1.180.0060.00318.10
8.1.170.0040.00419.14
8.1.160.0040.00419.07
8.1.150.0060.00318.80
8.1.140.0000.00717.64
8.1.130.0030.00318.07
8.1.120.0050.00317.61
8.1.110.0000.00717.55
8.1.100.0040.00417.68
8.1.90.0040.00417.56
8.1.80.0050.00317.56
8.1.70.0030.00317.60
8.1.60.0090.00417.82
8.1.50.0000.00717.77
8.1.40.0040.00417.63
8.1.30.0030.00517.90
8.1.20.0040.00417.87
8.1.10.0030.00617.71
8.1.00.0040.00417.85
8.0.300.0030.00520.28
8.0.290.0040.00417.13
8.0.280.0000.00718.73
8.0.270.0070.00017.44
8.0.260.0080.00017.05
8.0.250.0050.00317.25
8.0.240.0050.00217.07
8.0.230.0000.00717.19
8.0.220.0040.00416.98
8.0.210.0040.00317.20
8.0.200.0030.00317.12
8.0.190.0030.00517.06
8.0.180.0040.00417.23
8.0.170.0030.00617.09
8.0.160.0000.00817.06
8.0.150.0050.00316.96
8.0.140.0050.00317.03
8.0.130.0000.00613.64
8.0.120.0090.00017.19
8.0.110.0070.00016.96
8.0.100.0040.00417.10
8.0.90.0000.00717.06
8.0.80.0060.00917.11
8.0.70.0040.00417.16
8.0.60.0080.00017.14
8.0.50.0050.00217.10
8.0.30.0140.00617.27
8.0.20.0120.00917.22
8.0.10.0070.00017.32
8.0.00.0100.01216.97
7.4.330.0000.00513.30
7.4.320.0060.00016.78
7.4.300.0030.00716.84
7.4.290.0030.00316.71
7.4.280.0060.00316.84
7.4.270.0000.00816.77
7.4.260.0030.00313.61
7.4.250.0080.00016.65
7.4.240.0000.00716.77
7.4.230.0040.00416.83
7.4.220.0060.01316.88
7.4.210.0110.00416.81
7.4.200.0040.00416.66
7.4.190.0070.00016.59
7.4.160.0070.00716.79
7.4.150.0060.01216.65
7.4.140.0070.01016.75
7.4.130.0100.00716.88
7.4.120.0110.00616.80
7.4.110.0100.00717.02
7.4.100.0060.01116.66
7.4.90.0120.00616.82
7.4.80.0150.00916.77
7.4.70.0040.01416.78
7.4.60.0100.00716.70
7.4.50.0000.00716.39
7.4.40.0070.01116.51
7.4.30.0100.00716.61
7.4.10.0070.01115.41
7.4.00.0070.01015.19
7.3.330.0060.00013.36
7.3.320.0050.00013.33
7.3.310.0040.00416.59
7.3.300.0000.00716.45
7.3.290.0020.01216.57
7.3.280.0060.01016.51
7.3.270.0140.00316.79
7.3.260.0100.01016.52
7.3.250.0070.01216.79
7.3.240.0160.00016.94
7.3.230.0070.01416.54
7.3.210.0060.01816.56
7.3.200.0000.01719.39
7.3.190.0140.00316.73
7.3.180.0100.00716.48
7.3.170.0070.01416.60
7.3.160.0060.01016.81
7.3.130.0080.01114.66
7.3.120.0060.00814.96
7.3.110.0030.01315.02
7.3.100.0080.00414.84
7.3.90.0030.00915.02
7.3.80.0070.00714.87
7.3.70.0030.00615.18
7.3.60.0070.00715.11
7.3.50.0000.00914.81
7.3.40.0000.01315.06
7.3.30.0000.01214.84
7.3.20.0050.00516.77
7.3.10.0040.00816.71
7.3.00.0040.01116.94
7.2.330.0140.00316.97
7.2.320.0130.00316.74
7.2.310.0140.00317.05
7.2.300.0090.01216.96
7.2.290.0060.01216.77
7.2.260.0070.01015.28
7.2.250.0030.01615.10
7.2.240.0040.01115.29
7.2.230.0030.01315.03
7.2.220.0060.00314.98
7.2.210.0040.00815.04
7.2.200.0000.00914.95
7.2.190.0000.01015.11
7.2.180.0030.00615.03
7.2.170.0060.00614.96
7.2.160.0030.01315.05
7.2.150.0070.01017.16
7.2.140.0110.00616.83
7.2.130.0030.00917.14
7.2.120.0030.01517.04
7.2.110.0040.00816.93
7.2.100.0150.00016.90
7.2.90.0080.00517.24
7.2.80.0000.02017.12
7.2.70.0060.01017.28
7.2.60.0070.01016.95
7.2.50.0040.00816.95
7.2.40.0090.00617.15
7.2.30.0030.00616.82
7.2.20.0070.00717.15
7.2.10.0030.01417.15
7.2.00.0020.01118.47
7.1.330.0070.00715.82
7.1.320.0000.00915.70
7.1.310.0070.00416.08
7.1.300.0000.00915.78
7.1.290.0050.00315.59
7.1.280.0090.00315.90
7.1.270.0050.00515.83
7.1.260.0100.00015.92
7.1.250.0100.00315.79
7.1.240.0000.01115.80
7.1.230.0030.01315.74
7.1.220.0060.00915.95
7.1.210.0000.01215.71
7.1.200.0130.00315.90
7.1.190.0060.00916.01
7.1.180.0060.00915.75
7.1.170.0100.00315.95
7.1.160.0030.01415.76
7.1.150.0000.01115.84
7.1.140.0040.01115.94
7.1.130.0090.00616.05
7.1.120.0120.00316.02
7.1.110.0000.01715.73
7.1.100.0100.00517.04
7.1.90.0040.01215.94
7.1.80.0000.00815.66
7.1.70.0010.00816.46
7.1.60.0080.00817.49
7.1.50.0060.00716.39
7.1.40.0070.00715.84
7.1.30.0090.00615.77
7.1.20.0060.00616.04
7.1.10.0030.00715.97
7.1.00.0020.05219.05
7.0.330.0030.00715.36
7.0.320.0080.00415.28
7.0.310.0000.01615.49
7.0.300.0000.01115.27
7.0.290.0000.01515.42
7.0.280.0050.00515.52
7.0.270.0030.00615.27
7.0.260.0050.00315.52
7.0.250.0000.01015.81
7.0.240.0030.01215.54
7.0.230.0060.00615.58
7.0.220.0060.00615.70
7.0.210.0040.00415.67
7.0.200.0040.01116.13
7.0.190.0110.00315.65
7.0.180.0070.00315.38
7.0.170.0130.00015.55
7.0.160.0070.00715.32
7.0.150.0040.00715.67
7.0.140.0070.04118.75
7.0.130.0050.00515.54
7.0.120.0100.03318.72
7.0.110.0070.00715.61
7.0.100.0060.00915.66
7.0.90.0080.00415.41
7.0.80.0040.00815.73
7.0.70.0150.00015.85
7.0.60.0050.03217.78
7.0.50.0050.04416.74
7.0.40.0100.04516.98
7.0.30.0310.03216.92
7.0.20.0170.04317.00
7.0.10.0030.04617.03
7.0.00.0100.04316.97
5.6.400.0000.01414.84
5.6.390.0090.00614.64
5.6.380.0080.00514.54
5.6.370.0090.00414.91
5.6.360.0030.00914.69
5.6.350.0040.01114.19
5.6.340.0000.01014.32
5.6.330.0040.01214.65
5.6.320.0050.00514.47
5.6.310.0070.00414.20
5.6.300.0000.00914.70
5.6.290.0070.00714.15
5.6.280.0060.04017.80
5.6.270.0120.00314.59
5.6.260.0070.00714.35
5.6.250.0090.00314.45
5.6.240.0060.00614.36
5.6.230.0070.00714.67
5.6.220.0060.00314.36
5.6.210.0060.03817.57
5.6.200.0070.04516.36
5.6.190.0120.02017.57
5.6.180.0120.03917.76
5.6.170.0150.04517.53
5.6.160.0060.03117.51
5.6.150.0070.02816.38
5.6.140.0070.04516.48
5.6.130.0060.02816.31
5.6.120.0050.04017.83
5.6.110.0070.03017.73
5.6.100.0000.03017.81
5.6.90.0180.03417.83
5.6.80.0050.04117.41
5.6.70.2300.02117.41
5.6.60.0150.00014.27
5.6.50.0030.01414.27
5.6.40.0030.00514.22
5.6.30.0070.00714.38
5.6.20.0060.00614.35
5.6.10.0040.01214.36
5.6.00.0030.00914.41
5.5.380.0070.00714.46
5.5.370.0040.01114.32
5.5.360.0030.01014.55
5.5.350.0100.04117.51
5.5.340.0060.03516.29
5.5.330.0080.04717.45
5.5.320.0130.04217.26
5.5.310.0130.03517.56
5.5.300.0080.03716.38
5.5.290.0100.03816.36
5.5.280.0060.02817.67
5.5.270.0050.02517.83
5.5.260.0070.04817.42
5.5.250.0060.03317.68
5.5.240.0120.02617.36
5.5.230.0000.01114.38
5.5.220.0110.00314.21
5.5.210.0030.01414.33
5.5.200.0070.00314.37
5.5.190.0000.01514.35
5.5.180.0050.00514.44
5.5.170.0060.00314.24
5.5.160.0040.00414.15
5.5.150.0060.00814.34
5.5.140.0000.01714.06
5.5.130.0130.00014.31
5.5.120.0030.00714.46
5.5.110.0030.01214.48
5.5.100.0060.00914.42
5.5.90.0030.01014.40
5.5.80.0000.01714.48
5.5.70.0030.01014.43
5.5.60.0070.00714.12
5.5.50.0100.00014.43
5.5.40.0120.00014.62
5.5.30.0070.00414.33
5.5.20.0040.00814.41
5.5.10.0100.00314.23
5.5.00.0060.00614.36
5.4.450.0030.03316.13
5.4.440.0080.02515.99
5.4.430.0070.02316.08
5.4.420.0090.02016.13
5.4.410.0060.03616.00
5.4.400.0050.03515.81
5.4.390.0070.04215.98
5.4.380.0100.03715.74
5.4.370.0100.02815.83
5.4.360.0020.02515.82
5.4.350.0090.02315.98
5.4.340.0060.03915.90
5.4.330.0070.00012.57
5.4.320.0050.02715.94
5.4.310.0020.03415.93
5.4.300.0050.04215.97
5.4.290.0020.03015.90
5.4.280.0020.02415.97
5.4.270.0070.02015.93
5.4.260.0050.04015.75
5.4.250.0020.02315.89
5.4.240.0060.02115.75
5.4.230.0060.02215.75
5.4.220.0070.03115.92
5.4.210.0050.04315.81
5.4.200.0140.03215.82
5.4.190.0020.04016.00
5.4.180.0070.03815.82
5.4.170.0050.04315.93
5.4.160.0050.03815.74
5.4.150.0070.04015.75
5.4.140.0020.02914.60
5.4.130.0060.02914.46
5.4.120.0070.01714.62
5.4.110.0040.02214.57
5.4.100.0120.03214.59
5.4.90.0080.01814.55
5.4.80.0020.02314.55
5.4.70.0050.03814.56
5.4.60.0090.01714.55
5.4.50.0070.03814.54
5.4.40.0020.04014.56
5.4.30.0080.02114.55
5.4.20.0150.02814.57
5.4.10.0060.03914.55
5.4.00.0070.01814.24
5.3.290.0050.03213.63
5.3.280.0030.03913.55
5.3.270.0040.03613.55
5.3.260.0090.01713.67
5.3.250.0050.04013.60
5.3.240.0050.03213.62
5.3.230.0030.02113.58
5.3.220.0050.04113.57
5.3.210.0010.04513.65
5.3.200.0060.02613.58
5.3.190.0030.02613.52
5.3.180.0070.02013.58
5.3.170.0060.04313.57
5.3.160.0050.03013.58
5.3.150.0050.03813.58
5.3.140.0050.03313.59
5.3.130.0050.03813.59
5.3.120.0030.02713.58
5.3.110.0100.03713.56
5.3.100.0000.02313.32
5.3.90.0020.02613.32
5.3.80.0070.02013.38
5.3.70.0070.02413.33
5.3.60.0050.04013.28
5.3.50.0030.03013.30
5.3.40.0030.02413.21
5.3.30.0020.02713.19
5.3.20.0050.01913.16
5.3.10.0020.02213.15
5.3.00.0050.01813.07
5.2.170.0070.06311.16
5.2.160.0000.03311.08
5.2.150.0030.03011.16
5.2.140.0000.03311.32
5.2.130.0030.02711.09
5.2.120.0000.03011.08
5.2.110.0030.03311.07
5.2.100.0030.02711.12
5.2.90.0000.03011.11
5.2.80.0000.03011.06
5.2.70.0070.03011.10
5.2.60.0030.02711.01
5.2.50.0070.02711.04
5.2.40.0070.02310.93
5.2.30.0000.03011.14
5.2.20.0100.02710.89
5.2.10.0030.02710.94
5.2.00.0000.03010.80
5.1.60.0000.0239.99
5.1.50.0030.02310.08
5.1.40.0000.0279.90
5.1.30.0000.02710.24
5.1.20.0030.02710.53
5.1.10.0070.02710.06
5.1.00.0030.0239.99
5.0.50.0000.0208.56
5.0.40.0000.0208.54
5.0.30.0000.0308.28
5.0.20.0070.0178.12
5.0.10.0030.0178.33
5.0.00.0000.0308.15
4.4.90.0030.0137.71
4.4.80.0000.0177.71
4.4.70.0070.0107.71
4.4.60.0000.0177.71
4.4.50.0000.0177.71
4.4.40.0000.0237.71
4.4.30.0000.0177.71
4.4.20.0000.0177.71
4.4.10.0000.0137.71
4.4.00.0000.0237.71
4.3.110.0000.0137.71
4.3.100.0000.0137.71
4.3.90.0000.0137.71
4.3.80.0000.0237.71
4.3.70.0000.0137.71
4.3.60.0070.0107.71
4.3.50.0000.0177.71
4.3.40.0000.0237.71
4.3.30.0000.0137.71
4.3.20.0000.0137.71
4.3.10.0000.0137.71
4.3.00.0000.0177.71

preferences:
45.46 ms | 400 KiB | 5 Q