3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = '<?xml version="1.0" encoding="ISO-8859-1" ?> <Servicos> <cServico> <Codigo>40010</Codigo> </cServico> </Servicos>'; $b = '<?xml version="1.0" encoding="ISO-8859-1" ?> <Servicos> <cServico> <Codigo>40010</Codigo> </cServico> <cServico> <Codigo>40011</Codigo> </cServico> </Servicos>'; function getCodes(SimpleXMLElement $xml) { $codes = array(); foreach ($xml->cServico as $item) { $codes[] = (string)$item->Codigo; } return $codes; } var_dump(getCodes(new SimpleXMLElement($a))); var_dump(getCodes(new SimpleXMLElement($b)));

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.10.0070.01019.86
8.5.00.0090.01420.33
8.4.150.0020.00114.05
8.4.140.0100.01117.82
8.4.130.0100.01117.93
8.4.120.0140.00520.94
8.4.110.0090.01222.54
8.4.100.0130.00818.05
8.4.90.0120.00817.84
8.4.80.0090.01020.93
8.4.70.0100.01017.79
8.4.60.0140.00617.91
8.4.50.0160.00518.93
8.4.40.0150.00319.53
8.4.30.0130.00718.05
8.4.20.0070.01320.50
8.4.10.0080.00317.66
8.3.280.0140.00618.74
8.3.270.0140.00616.68
8.3.260.0070.00316.76
8.3.250.0100.00719.33
8.3.240.0110.00816.48
8.3.230.0110.00817.02
8.3.220.0070.00117.41
8.3.210.0080.01016.89
8.3.200.0110.01016.77
8.3.190.0090.01117.28
8.3.180.0040.00517.52
8.3.170.0070.01119.00
8.3.160.0070.01120.32
8.3.150.0040.01517.32
8.3.140.0150.00419.15
8.3.130.0000.00818.56
8.3.120.0050.00319.02
8.3.110.0060.00320.94
8.3.100.0040.00424.06
8.3.90.0040.00426.77
8.3.80.0050.00517.97
8.3.70.0060.00918.43
8.3.60.0100.01018.56
8.3.50.0120.00922.09
8.3.40.0090.00918.92
8.3.30.0090.00618.99
8.3.20.0040.00421.98
8.3.10.0040.00420.59
8.3.00.0000.00820.89
8.2.290.0120.00620.65
8.2.280.0110.00916.91
8.2.270.0150.00319.34
8.2.260.0120.00619.43
8.2.250.0050.00317.15
8.2.240.0030.00619.11
8.2.230.0110.00022.58
8.2.220.0090.00937.54
8.2.210.0160.00026.77
8.2.200.0040.00816.63
8.2.190.0120.00616.75
8.2.180.0090.00620.48
8.2.170.0040.01122.96
8.2.160.0070.00720.55
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0060.00326.16
8.2.120.0040.00421.12
8.2.110.0040.00420.35
8.2.100.0120.00018.03
8.2.90.0080.00020.67
8.2.80.0000.00818.29
8.2.70.0040.00418.28
8.2.60.0040.00418.47
8.2.50.0040.00418.10
8.2.40.0050.00322.39
8.2.30.0040.00420.71
8.2.20.0080.00018.26
8.2.10.0040.00418.37
8.2.00.0040.00418.37
8.1.330.0120.00823.95
8.1.320.0110.00718.34
8.1.310.0140.00318.47
8.1.300.0050.00517.80
8.1.290.0030.00630.84
8.1.280.0070.01125.92
8.1.270.0030.00623.88
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0030.00624.02
8.1.230.0070.00421.05
8.1.220.0000.00817.89
8.1.210.0040.00419.06
8.1.200.0000.00817.48
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0060.00319.05
8.1.160.0040.00419.10
8.1.150.0040.00420.47
8.1.140.0080.00019.63
8.1.130.0080.00019.12
8.1.120.0070.00017.68
8.1.110.0050.00317.70
8.1.100.0080.00017.57
8.1.90.0030.00517.57
8.1.80.0000.00917.55
8.1.70.0030.00317.56
8.1.60.0040.00417.79
8.1.50.0050.00317.74
8.1.40.0030.00617.66
8.1.30.0030.00617.78
8.1.20.0060.00317.85
8.1.10.0030.00617.83
8.1.00.0050.00317.65
8.0.300.0000.00820.16
8.0.290.0060.00317.00
8.0.280.0030.00318.66
8.0.270.0080.00017.53
8.0.260.0030.00317.53
8.0.250.0030.00317.17
8.0.240.0030.00417.28
8.0.230.0040.00417.30
8.0.220.0030.00517.14
8.0.210.0040.00717.07
8.0.200.0070.00017.20
8.0.190.0030.00317.13
8.0.180.0000.00817.08
8.0.170.0040.00417.11
8.0.160.0000.00717.19
8.0.150.0040.00417.07
8.0.140.0040.00417.20
8.0.130.0050.00013.55
8.0.120.0080.00017.04
8.0.110.0000.00717.05
8.0.100.0000.00817.07
8.0.90.0050.00316.99
8.0.80.0090.00617.10
8.0.70.0000.00717.18
8.0.60.0040.00416.96
8.0.50.0040.00416.98
8.0.30.0080.01217.29
8.0.20.0110.01017.44
8.0.10.0000.00717.11
8.0.00.0060.01316.98
7.4.330.0000.00615.55
7.4.320.0060.00016.77
7.4.300.0000.00616.82
7.4.290.0000.00716.82
7.4.280.0000.00716.82
7.4.270.0000.00716.80
7.4.260.0070.00016.81
7.4.250.0020.00516.75
7.4.240.0070.00016.78
7.4.230.0000.00716.64
7.4.220.0110.00716.82
7.4.210.0110.01116.87
7.4.200.0030.00316.82
7.4.160.0080.00916.75
7.4.150.0180.00517.40
7.4.140.0110.00917.86
7.4.130.0090.00816.68
7.4.120.0090.00916.69
7.4.110.0070.01116.50
7.4.100.0090.01316.79
7.4.90.0090.00916.78
7.4.80.0140.00819.39
7.4.70.0070.01016.69
7.4.60.0130.00316.68
7.4.50.0060.01016.75
7.4.40.0120.00316.52
7.4.30.0030.01416.83
7.4.00.0120.00315.28
7.3.330.0040.00413.32
7.3.320.0050.00013.20
7.3.310.0000.00816.43
7.3.300.0040.00416.39
7.3.290.0030.00316.43
7.3.280.0080.01016.42
7.3.270.0120.00617.40
7.3.260.0130.00716.70
7.3.250.0090.00816.67
7.3.240.0100.00816.59
7.3.230.0110.00816.70
7.3.210.0100.00716.65
7.3.200.0100.00716.63
7.3.190.0140.00316.66
7.3.180.0130.00316.30
7.3.170.0100.00616.49
7.3.160.0080.01216.81
7.3.10.0040.01016.48
7.3.00.0090.01116.55
7.2.330.0090.00916.69
7.2.320.0090.00916.98
7.2.310.0130.00416.91
7.2.300.0080.01116.93
7.2.290.0080.00816.96
7.2.130.0060.00916.93
7.2.120.0040.01216.93
7.2.110.0070.01216.54
7.2.100.0050.00916.78
7.2.90.0080.00816.68
7.2.80.0080.00716.73
7.2.70.0080.00816.68
7.2.60.0100.01016.76
7.2.50.0100.01016.71
7.2.40.0090.00616.89
7.2.30.0080.01116.92
7.2.20.0100.00816.96
7.2.10.0100.01016.88
7.2.00.0070.00916.97
7.1.250.0090.00615.78
7.1.200.0070.00715.90
7.1.70.0080.00017.14
7.1.60.0040.01217.25
7.1.20.1130.06038.58
7.1.10.1600.06320.43
7.1.00.1730.06320.75
7.0.200.0090.00616.98
7.0.160.1500.06020.04
7.0.150.0870.06320.06
7.0.140.2030.07720.03
7.0.130.1830.07020.16
7.0.120.1830.06320.20
7.0.110.1570.07020.16
7.0.100.0230.07020.07
7.0.90.1530.08020.19
7.0.80.0200.05320.12
7.0.70.1030.07720.03
7.0.60.1800.08020.29
7.0.50.1700.07720.21
7.0.40.0200.07020.16
7.0.30.1200.07720.09
7.0.20.0200.06320.18
7.0.10.1800.05320.09
7.0.00.0930.07720.17

preferences:
183.07 ms | 403 KiB | 5 Q