3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * This demos a (possible) bug in PHP, which is observed in PHP 5.6, 7.2, 7.3, 7.4 and 8.0 (not tested on 8.1) * * Access behaviour of a SimpleXMLElement changes if that node has a sibling. * * In this example, adding 'fiz' to 'foo' (which is the outer node) will change behaviour when accessing 'bar' (an inner node) */ $xml_1 = new SimpleXMLElement('<foo><bar><baz/></bar></foo>'); print_r($xml_1); // As expected print_r($xml_1->bar); // As expected, $bar contains property $baz, which is an empty SimpleXMLElement $xml_2 = new SimpleXMLElement('<foo><bar><baz/></bar><fiz/></foo>'); print_r($xml_2); // As expected, property $bar is equal to that observed in print_r($xml_1) print_r($xml_2->bar); // UNEXPECTED: property $bar is an array, containing one SimpleXMLElement with property $baz which is an empty SimpleXMLElement

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.5.30.0100.00918.88
8.5.20.0100.00719.68
8.5.10.0140.00416.64
8.5.00.0120.00919.96
8.4.180.0130.01019.81
8.4.170.0120.01023.87
8.4.160.0090.01323.28
8.4.150.0090.00416.96
8.4.140.0150.00717.87
8.4.130.0130.00718.00
8.4.120.0130.00620.55
8.4.110.0110.00920.00
8.4.100.0140.00518.82
8.4.90.0140.00722.71
8.4.80.0090.00417.78
8.4.70.0120.00818.40
8.4.60.0130.00620.68
8.4.50.0150.00420.51
8.4.40.0170.00318.04
8.4.30.0090.00620.77
8.4.20.0170.00418.27
8.4.10.0090.01219.46
8.3.300.0130.00721.16
8.3.290.0120.01021.10
8.3.280.0110.00818.56
8.3.270.0130.00616.38
8.3.260.0140.00516.67
8.3.250.0130.00518.77
8.3.240.0120.00717.34
8.3.230.0110.00716.65
8.3.220.0030.00617.45
8.3.210.0130.00516.61
8.3.200.0040.00516.89
8.3.190.0120.00819.25
8.3.180.0110.01018.40
8.3.170.0090.01217.40
8.3.160.0040.00418.29
8.3.150.0100.01016.71
8.3.140.0090.00917.37
8.3.130.0000.00918.40
8.3.120.0000.01019.15
8.3.110.0130.00620.94
8.3.100.0090.00624.06
8.3.90.0060.00326.77
8.3.80.0060.00316.63
8.3.70.0120.00616.71
8.3.60.0070.00718.43
8.3.50.0150.00620.21
8.3.40.0100.01018.83
8.3.30.0120.00418.88
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0050.00326.16
8.2.300.0090.01120.43
8.2.290.0130.00520.57
8.2.280.0050.00418.74
8.2.270.0130.00617.07
8.2.260.0040.00416.90
8.2.250.0110.00717.08
8.2.240.0060.01319.26
8.2.230.0040.00422.58
8.2.220.0090.00937.54
8.2.210.0050.00326.77
8.2.200.0060.00317.00
8.2.190.0110.00316.75
8.2.180.0130.00625.92
8.2.170.0090.00618.96
8.2.160.0110.01122.96
8.2.150.0050.00225.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00619.89
8.2.110.0110.00722.18
8.2.100.0030.00917.91
8.2.90.0030.00522.61
8.2.80.0000.00818.91
8.2.70.0060.00317.75
8.2.60.0040.00418.05
8.2.50.0040.00418.07
8.2.40.0030.00620.19
8.2.30.0070.00017.77
8.2.20.0040.00420.78
8.2.10.0020.00517.71
8.2.00.0080.00019.35
8.1.340.0150.00817.70
8.1.330.0060.00322.21
8.1.320.0120.00716.10
8.1.310.0030.00518.96
8.1.300.0120.00620.08
8.1.290.0040.00818.88
8.1.280.0130.00625.92
8.1.270.0040.00423.99
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0060.00322.86
8.1.230.0110.00017.95
8.1.220.0040.00417.91
8.1.210.0000.00818.77
8.1.200.0030.00617.47
8.1.190.0040.00417.38
8.1.180.0000.01118.10
8.1.170.0030.00518.77
8.1.160.0000.00718.96
8.1.150.0000.00818.85
8.1.140.0000.00817.61
8.1.130.0070.00017.44
8.1.120.0040.00417.57
8.1.110.0040.00417.57
8.1.100.0000.00717.51
8.1.90.0040.00417.50
8.1.80.0040.00717.57
8.1.70.0030.00317.54
8.1.60.0050.00317.75
8.1.50.0030.00617.55
8.1.40.0060.00317.66
8.1.30.0040.00417.65
8.1.20.0000.00817.68
8.1.10.0030.00617.64
8.1.00.0020.00817.64
8.0.300.0040.00418.90
8.0.290.0030.00616.59
8.0.280.0000.00718.55
8.0.270.0040.00416.97
8.0.260.0070.00016.97
8.0.250.0030.00317.12
8.0.240.0030.00317.10
8.0.230.0030.00317.01
8.0.220.0030.00317.00
8.0.210.0000.00717.09
8.0.200.0060.00016.97
8.0.190.0030.00717.16
8.0.180.0080.00017.06
8.0.170.0040.00416.93
8.0.160.0030.00517.09
8.0.150.0000.00717.04
8.0.140.0070.00017.00
8.0.130.0130.00516.96
8.0.120.0190.00417.00
8.0.110.0130.00916.84
8.0.100.0160.00316.94
8.0.90.0180.00416.93
8.0.80.0180.00116.99
8.0.70.0160.00316.93
8.0.60.0160.00316.94
8.0.50.0130.00816.90
8.0.30.0110.00816.94
8.0.20.0210.00417.10
8.0.10.0140.00717.07
8.0.00.0070.00817.05
7.4.330.0030.00315.55
7.4.320.0040.00416.61
7.4.300.0030.00316.60
7.4.290.0030.00316.46
7.4.280.0070.00316.60
7.4.270.0040.00416.57
7.4.260.0210.00316.64
7.4.250.0170.00616.61
7.4.240.0160.00616.57
7.4.230.0240.00116.61
7.4.220.0190.00416.63
7.4.210.0170.00316.64
7.4.200.0140.00516.51
7.4.190.0130.00816.64
7.4.180.0150.00416.55
7.4.160.0190.00216.55
7.4.150.0150.00416.62
7.4.140.0190.00316.56
7.4.130.0150.00416.32
7.4.120.0120.00516.51
7.4.110.0160.00516.41
7.4.100.0140.00516.63
7.4.90.0130.00516.60
7.4.80.0150.00616.40
7.4.70.0090.00916.34
7.4.60.0160.00216.36
7.4.50.0150.00316.39
7.4.40.0150.00316.41
7.4.30.0100.00716.47
7.4.20.0130.00816.44
7.4.10.0110.00716.46
7.4.00.0110.00216.60
7.3.330.0130.00616.29
7.3.320.0130.00716.22
7.3.310.0140.00416.38
7.3.300.0120.00516.25
7.3.290.0130.00616.43
7.3.280.0180.00016.15
7.3.270.0090.00916.10
7.3.260.0140.00216.31
7.3.250.0100.00716.32
7.3.240.0150.00516.26
7.3.230.0120.00716.22
7.3.220.0130.00716.11
7.3.210.0140.00416.23
7.3.200.0140.00216.33
7.3.190.0200.00516.29
7.3.180.0100.00816.37
7.3.170.0130.00416.09
7.3.160.0120.00716.33
7.3.150.0200.00216.11
7.3.140.0180.00216.08
7.3.130.0160.00316.13

preferences:
60.41 ms | 1473 KiB | 5 Q