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; } } $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->keyHasTwins('row')); var_dump($rows->keyHasTwins('row2')); var_dump($rows->keyHasTwins('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).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0120.00618.68
8.3.50.0110.00922.24
8.3.40.0070.00718.97
8.3.30.0110.00718.77
8.3.20.0080.00018.68
8.3.10.0050.00321.21
8.3.00.0060.00322.10
8.2.180.0070.00716.63
8.2.170.0110.00422.96
8.2.160.0130.00720.64
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0020.00521.29
8.2.110.0050.00521.18
8.2.100.0000.01117.97
8.2.90.0040.00419.38
8.2.80.0080.00018.05
8.2.70.0100.00017.75
8.2.60.0070.00418.12
8.2.50.0040.00418.07
8.2.40.0030.00618.41
8.2.30.0040.00420.12
8.2.20.0040.00417.83
8.2.10.0000.00818.01
8.2.00.0000.00817.95
8.1.280.0180.00425.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0000.01023.96
8.1.230.0110.00021.21
8.1.220.0030.00518.77
8.1.210.0030.00519.21
8.1.200.0030.00617.60
8.1.190.0040.00417.66
8.1.180.0000.00818.10
8.1.170.0000.00818.83
8.1.160.0030.00519.00
8.1.150.0040.00418.80
8.1.140.0040.00417.69
8.1.130.0030.00318.16
8.1.120.0000.00817.67
8.1.110.0040.00417.54
8.1.100.0030.00517.59
8.1.90.0050.00317.60
8.1.80.0030.00517.71
8.1.70.0000.00717.70
8.1.60.0000.00817.77
8.1.50.0040.00417.68
8.1.40.0000.00817.70
8.1.30.0030.00617.84
8.1.20.0050.00317.78
8.1.10.0030.00517.75
8.1.00.0070.00717.62
8.0.300.0000.00720.23
8.0.290.0070.00017.40
8.0.280.0000.00718.63
8.0.270.0030.00317.55
8.0.260.0000.00817.11
8.0.250.0000.00717.26
8.0.240.0050.00517.25
8.0.230.0000.00717.14
8.0.220.0030.00317.05
8.0.210.0070.00017.07
8.0.200.0050.00217.23
8.0.190.0050.00317.12
8.0.180.0000.01017.18
8.0.170.0040.00417.16
8.0.160.0030.00417.09
8.0.150.0050.00317.02
8.0.140.0000.00817.10
8.0.130.0000.00613.62
8.0.120.0050.00516.95
8.0.110.0050.00217.21
8.0.100.0050.00217.18
8.0.90.0040.00416.88
8.0.80.0060.00917.05
8.0.70.0080.00017.05
8.0.60.0040.00416.95
8.0.50.0070.00016.98
8.0.30.0120.01117.29
8.0.20.0130.00617.43
8.0.10.0040.00417.29
8.0.00.0120.00616.94
7.4.330.0000.00514.99
7.4.320.0030.00316.83
7.4.300.0030.00316.75
7.4.290.0040.00416.64
7.4.280.0030.00416.64
7.4.270.0000.00716.71
7.4.260.0030.00313.57
7.4.250.0040.00416.80
7.4.240.0030.00316.91
7.4.230.0000.00716.93
7.4.220.0130.00616.73
7.4.210.0100.00416.74
7.4.200.0030.00316.93
7.4.190.0030.00516.79
7.4.160.0050.01016.66
7.4.150.0300.01617.40
7.4.140.0090.00817.86
7.4.130.0140.00216.78
7.4.120.0080.00916.71
7.4.110.0030.01416.73
7.4.100.0070.01416.78
7.4.90.0040.01216.71
7.4.80.0120.00619.37
7.4.70.0070.01216.82
7.4.60.0100.00716.57
7.4.50.0060.00316.38
7.4.40.0000.01922.27
7.4.30.0130.00316.63
7.4.10.0100.01014.84
7.4.00.0070.00915.23
7.3.330.0000.00513.59
7.3.320.0050.00013.56
7.3.310.0050.00216.65
7.3.300.0070.00016.48
7.3.290.0110.00616.64
7.3.280.0060.01016.61
7.3.270.0110.00617.40
7.3.260.0110.00718.24
7.3.250.0090.00816.84
7.3.240.0100.00616.69
7.3.230.0110.00616.83
7.3.210.0090.01016.70
7.3.200.0110.01119.39
7.3.190.0110.00616.57
7.3.180.0060.00916.63
7.3.170.0040.01116.60
7.3.160.0000.01716.74
7.3.130.0030.01615.04
7.3.120.0060.01115.13
7.3.110.0070.01214.92
7.3.100.0080.00614.87
7.3.90.0090.00415.01
7.3.80.0070.00715.03
7.3.70.0050.00814.96
7.3.60.0050.00715.02
7.3.50.0060.00814.96
7.3.40.0070.00914.92
7.3.30.0070.00314.90
7.3.20.0060.00516.69
7.3.10.0030.01016.67
7.3.00.0080.00616.88
7.2.330.0070.01016.82
7.2.320.0160.00717.05
7.2.310.0110.00617.04
7.2.300.0030.01416.96
7.2.290.0030.01316.81
7.2.260.0030.01615.26
7.2.250.0030.01415.14
7.2.240.0100.00615.36
7.2.230.0050.00915.42
7.2.220.0060.01115.11
7.2.210.0020.01314.93
7.2.200.0090.00615.11
7.2.190.0050.00715.28
7.2.180.0080.00515.13
7.2.170.0030.01215.24
7.2.160.0060.00615.17
7.2.150.0030.00817.10
7.2.140.0060.00817.13
7.2.130.0080.00817.08
7.2.120.0070.00517.10
7.2.110.0030.01216.99
7.2.100.0060.00617.07
7.2.90.0070.00817.04
7.2.80.0050.01017.12
7.2.70.0070.00817.17
7.2.60.0070.00817.04
7.2.50.0030.01317.15
7.2.40.0040.01017.15
7.2.30.0060.01016.99
7.2.20.0070.00816.99
7.2.10.0050.00816.99
7.2.00.0070.00817.70
7.1.330.0000.01415.97
7.1.320.0000.01516.07
7.1.310.0040.00915.74
7.1.300.0020.01015.79
7.1.290.0020.01115.92
7.1.280.0050.00815.80
7.1.270.0050.00515.88
7.1.260.0030.01115.96
7.1.250.0040.01015.84
7.1.240.0040.00815.93
7.1.230.0070.00515.78
7.1.220.0050.00815.76
7.1.210.0050.00915.88
7.1.200.0090.00915.99
7.1.190.0070.00815.73
7.1.180.0080.00315.76
7.1.170.0050.00815.93
7.1.160.0030.00916.01
7.1.150.0050.00715.95
7.1.140.0080.00716.02
7.1.130.0060.00915.90
7.1.120.0030.00815.82
7.1.110.0030.00915.92
7.1.100.0050.00916.70
7.1.90.0040.00816.01
7.1.80.0090.00315.87
7.1.70.0060.00516.35
7.1.60.0050.01217.06
7.1.50.0070.00916.22
7.1.40.0070.00715.80
7.1.30.0050.00516.02
7.1.20.0050.00515.91
7.1.10.0080.00415.90
7.1.00.0090.02618.01
7.0.330.0050.00415.32
7.0.320.0030.01215.42
7.0.310.0030.01215.61
7.0.300.0020.00715.53
7.0.290.0030.00915.45
7.0.280.0030.01015.63
7.0.270.0080.00415.59
7.0.260.0030.01015.42
7.0.250.0090.00215.40
7.0.240.0020.01115.57
7.0.230.0030.00715.50
7.0.220.0040.00615.54
7.0.210.0060.00515.65
7.0.200.0070.00515.80
7.0.190.0090.00715.59
7.0.180.0020.01215.59
7.0.170.0030.00715.71
7.0.160.0070.00515.66
7.0.150.0030.00915.49
7.0.140.0090.02817.75
7.0.130.0090.00415.42
7.0.120.0030.00715.53
7.0.110.0050.00815.48
7.0.100.0040.00815.46
7.0.90.0020.01115.46
7.0.80.0060.00715.44
7.0.70.0040.01115.48
7.0.60.0060.01717.12
7.0.50.0080.01816.38
7.0.40.0060.02715.84
7.0.30.0200.01915.87
7.0.20.0140.02915.82
7.0.10.0130.02415.74
7.0.00.0070.03215.83
5.6.400.0000.01314.61
5.6.390.0010.01014.59
5.6.380.0060.00914.62
5.6.370.0030.01014.39
5.6.360.0070.00214.56
5.6.350.0050.00814.42
5.6.340.0060.00614.21
5.6.330.0030.00614.35
5.6.320.0030.01014.25
5.6.310.0020.01214.34
5.6.300.0050.01114.54
5.6.290.0060.00814.31
5.6.280.0050.02716.68
5.6.270.0040.00814.48
5.6.260.0060.00614.40
5.6.250.0070.00514.37
5.6.240.0030.00914.43
5.6.230.0040.00814.40
5.6.220.0040.00914.27
5.6.210.0040.02516.55
5.6.200.0080.01715.73
5.6.190.0050.03016.44
5.6.180.0110.01816.39
5.6.170.0470.02316.46
5.6.160.0030.02516.58
5.6.150.0080.02215.78
5.6.140.0060.01815.79
5.6.130.0060.03415.72
5.6.120.0080.01816.84
5.6.110.0100.02816.67
5.6.100.0080.03116.58
5.6.90.0080.01516.50
5.6.80.0060.02616.65
5.6.70.1520.02216.39
5.6.60.0070.00514.43
5.6.50.0050.00714.40
5.6.40.0040.01014.42
5.6.30.0030.01014.50
5.6.20.0050.00714.30
5.6.10.0060.00814.38
5.6.00.0040.00914.27
5.5.380.0080.00514.43
5.5.370.0040.01214.38
5.5.360.0080.00314.49
5.5.350.0030.03416.53
5.5.340.0110.02615.53
5.5.330.0080.01816.28
5.5.320.0160.03216.45
5.5.310.0150.02616.38
5.5.300.0050.02315.69
5.5.290.0030.02415.59
5.5.280.0020.02316.68
5.5.270.0090.02216.53
5.5.260.0030.03716.57
5.5.250.0040.02016.37
5.5.240.0090.01616.34
5.5.230.0050.00714.37
5.5.220.0070.00614.47
5.5.210.0080.00514.28
5.5.200.0050.00714.40
5.5.190.0050.00714.32
5.5.180.0080.00814.21
5.5.170.0050.00814.47
5.5.160.0060.00514.34
5.5.150.0020.00914.51
5.5.140.0070.00714.46
5.5.130.0050.01014.48
5.5.120.0050.00814.37
5.5.110.0060.00314.35
5.5.100.0090.00414.37
5.5.90.0050.00814.29
5.5.80.0040.01014.28
5.5.70.0090.00414.39
5.5.60.0050.00714.29
5.5.50.0080.00514.31
5.5.40.0090.00514.31
5.5.30.0060.00814.28
5.5.20.0030.00714.20
5.5.10.0020.01014.41
5.5.00.0060.00814.37
5.4.450.0160.02914.41
5.4.440.0110.03214.49
5.4.430.0090.01814.49
5.4.420.0100.01614.49
5.4.410.0100.01814.35
5.4.400.0070.01914.40
5.4.390.0100.02314.33
5.4.380.0130.02414.34
5.4.370.0100.02714.29
5.4.360.0130.02314.36
5.4.350.0160.02214.35
5.4.340.0120.02514.38
5.4.330.0000.00711.80
5.4.320.0120.01614.34
5.4.310.0170.01614.38
5.4.300.0100.03014.40
5.4.290.0160.03114.46
5.4.280.0190.02014.39
5.4.270.0130.02014.37
5.4.260.0090.02014.27
5.4.250.0140.02614.34
5.4.240.0110.02014.24
5.4.230.0150.01414.33
5.4.220.0150.02514.33
5.4.210.0160.02814.35
5.4.200.0090.03214.39
5.4.190.0090.01614.40
5.4.180.0130.02614.41
5.4.170.0110.01914.36
5.4.160.0090.02814.40
5.4.150.0120.02014.43
5.4.140.0060.02213.53
5.4.130.0140.01113.50
5.4.120.0080.01713.48
5.4.110.0090.02113.42
5.4.100.0090.01713.54
5.4.90.0110.01313.49
5.4.80.0100.01813.48
5.4.70.0100.01713.48
5.4.60.0120.02713.60
5.4.50.0080.01613.46
5.4.40.0100.03013.42
5.4.30.0130.01713.49
5.4.20.0110.02313.46
5.4.10.0100.01413.37
5.4.00.0070.01913.32
5.3.290.0140.02312.72
5.3.280.0130.02112.73
5.3.270.0110.02612.72
5.3.260.0110.02112.76
5.3.250.0170.02112.78
5.3.240.0080.01712.68
5.3.230.0100.01512.71
5.3.220.0120.01512.64
5.3.210.0120.01712.65
5.3.200.0120.02212.73
5.3.190.0090.01512.63
5.3.180.0110.02612.72
5.3.170.0080.01712.77
5.3.160.0120.01612.76
5.3.150.0080.02712.72
5.3.140.0080.01812.65
5.3.130.0110.02712.72
5.3.120.0090.01612.70
5.3.110.0060.01912.72
5.3.100.0070.01912.50
5.3.90.0110.01312.61
5.3.80.0080.01612.49
5.3.70.0040.01912.50
5.3.60.0080.01712.56
5.3.50.0080.01812.45
5.3.40.0090.01812.46
5.3.30.0080.03012.52
5.3.20.0130.01312.38
5.3.10.0110.01412.34
5.3.00.0080.01812.33
5.2.170.0100.03311.45
5.2.160.0270.02711.34
5.2.150.0170.03011.20
5.2.140.0170.04011.35
5.2.130.0200.03011.10
5.2.120.0230.05711.18
5.2.110.0230.02711.19
5.2.100.0230.04311.20
5.2.90.0200.05711.26
5.2.80.0130.04311.14
5.2.70.0200.03011.10
5.2.60.0130.03011.23
5.2.50.0230.06011.26
5.2.40.0170.03711.09
5.2.30.0200.02711.01
5.2.20.0170.04711.21
5.2.10.0100.04710.91
5.2.00.0200.05710.72
5.1.60.0200.03310.03
5.1.50.0130.02310.02
5.1.40.0230.04010.25
5.1.30.0170.04010.39
5.1.20.0100.02710.36
5.1.10.0170.02310.11
5.1.00.0170.03310.13
5.0.50.0030.0279.98
5.0.40.0070.0209.98
5.0.30.0170.0579.98
5.0.20.0070.0209.98
5.0.10.0100.0209.98
5.0.00.0100.0609.98
4.4.90.0030.0209.98
4.4.80.0030.0179.98
4.4.70.0070.0209.98
4.4.60.0030.0239.98
4.4.50.0100.0239.98
4.4.40.0070.0309.98
4.4.30.0100.0179.98
4.4.20.0070.0139.98
4.4.10.0070.0239.98
4.4.00.0070.0279.98
4.3.110.0130.0209.98
4.3.100.0100.0209.98
4.3.90.0070.0309.98
4.3.80.0070.0239.98
4.3.70.0070.0179.98
4.3.60.0030.0179.98
4.3.50.0030.0209.98
4.3.40.0070.0409.98
4.3.30.0070.0239.98
4.3.20.0030.0279.98
4.3.10.0030.0379.98
4.3.00.0030.0309.98

preferences:
45.1 ms | 401 KiB | 5 Q