3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml_string = '<?xml version="1.0" encoding="utf-8"?> <livraria> <livro categoria="cozinha"> <titulo lang="en">Everyday Italian</titulo> <autor>Giada De Laurentiis</autor> <ano>2005</ano> <preco>30.00</preco> </livro> <livro categoria="juvenil"> <titulo lang="pt">Harry Potter e o Cálice de Fogo</titulo> <autor>J. K. Rowling</autor> <ano>2005</ano> <preco>29.99</preco> </livro> <livro categoria="web"> <titulo lang="en">Learning XML</titulo> <autor>Erik T. Ray</autor> <ano>2003</ano> <preco>39.95</preco> </livro> <livro categoria="ficcao"> <titulo lang="pt">Guia do Mochileiro das Galáxias, O</titulo> <autor>Douglas Adams</autor> <ano>1979</ano> <preco>19.95</preco> </livro> </livraria>'; $livraria = new SimpleXMLElement($xml_string); ?> <?php foreach($livraria->children() as $livro) :?> <ul> <li> <?=$livro->getName()?> <?php foreach($livro->attributes() as $attr) :?> <ul> <li> <?=$attr->getName() . " : " . $attr ?> <ul> <?php foreach($livro->children() as $item) :?> <li><?=$item->getName() . " : " . $item ?></li> <?php endforeach; ?> </ul> </li> </ul> <?php endforeach; ?> </li> </ul> <?php endforeach; ?><?php

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.0070.00716.87
8.3.50.0100.00822.13
8.3.40.0040.01118.96
8.3.30.0100.00719.25
8.3.20.0030.00520.51
8.3.10.0040.00422.03
8.3.00.0050.00319.13
8.2.180.0080.00818.91
8.2.170.0120.00322.96
8.2.160.0110.00420.45
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0060.01226.16
8.2.120.0000.00822.40
8.2.110.0080.00322.42
8.2.100.0070.00417.97
8.2.90.0000.00918.16
8.2.80.0000.00917.97
8.2.70.0030.00517.88
8.2.60.0030.00618.05
8.2.50.0060.00319.48
8.2.40.0030.00618.47
8.2.30.0070.00018.21
8.2.20.0050.00217.89
8.2.10.0000.00820.06
8.2.00.0000.01117.97
8.1.280.0060.01525.92
8.1.270.0000.00824.09
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0080.00320.95
8.1.230.0050.00521.03
8.1.220.0080.00017.76
8.1.210.0080.00019.20
8.1.200.0030.00617.47
8.1.190.0050.00317.68
8.1.180.0030.00618.10
8.1.170.0050.00318.83
8.1.160.0040.00422.22
8.1.150.0040.00418.82
8.1.140.0070.00017.64
8.1.130.0070.00018.03
8.1.120.0000.00817.66
8.1.110.0050.00317.73
8.1.100.0000.00817.75
8.1.90.0000.00717.74
8.1.80.0040.00717.59
8.1.70.0000.00717.69
8.1.60.0040.00417.87
8.1.50.0040.00417.81
8.1.40.0080.00017.64
8.1.30.0080.00017.93
8.1.20.0030.00617.91
8.1.10.0040.00417.69
8.1.00.0080.00017.66
8.0.300.0040.00420.12
8.0.290.0000.00817.41
8.0.280.0000.00718.66
8.0.270.0000.00717.43
8.0.260.0070.00017.47
8.0.250.0070.00017.07
8.0.240.0030.00317.20
8.0.230.0000.00717.25
8.0.220.0000.00817.11
8.0.210.0020.00517.01
8.0.200.0030.00317.23
8.0.190.0070.00017.07
8.0.180.0000.00717.18
8.0.170.0040.00417.10
8.0.160.0000.00717.01
8.0.150.0030.00517.15
8.0.140.0000.00817.16
8.0.130.0030.00313.59
8.0.120.0030.00517.14
8.0.110.0040.00417.03
8.0.100.0070.00017.09
8.0.90.0000.00817.21
8.0.80.0130.01017.20
8.0.70.0000.00817.15
8.0.60.0080.00017.12
8.0.50.0000.00717.01
8.0.30.0090.01117.27
8.0.20.0110.00917.40
8.0.10.0040.00417.15
8.0.00.0060.01217.15
7.4.330.0040.00415.00
7.4.320.0030.00316.82
7.4.300.0030.00316.91
7.4.290.0000.00816.75
7.4.280.0030.00316.61
7.4.270.0020.00516.82
7.4.260.0000.00816.75
7.4.250.0000.00716.79
7.4.240.0020.00616.76
7.4.230.0030.00316.64
7.4.220.0150.00316.85
7.4.210.0090.00816.73
7.4.200.0040.00416.84
7.4.190.0030.00416.94
7.4.160.0180.00616.66
7.4.150.0110.00717.40
7.4.140.0130.00517.86
7.4.130.0090.00916.68
7.4.120.0090.01016.75
7.4.110.0090.00916.68
7.4.100.0190.00316.59
7.4.90.0160.01016.65
7.4.80.0070.01119.39
7.4.70.0130.00316.86
7.4.60.0030.01316.74
7.4.50.0000.00816.48
7.4.40.0110.00722.77
7.4.30.0060.01016.90
7.3.330.0030.00313.17
7.3.320.0030.00313.02
7.3.310.0040.00416.53
7.3.300.0040.00416.40
7.3.290.0090.00616.54
7.3.280.0050.01416.49
7.3.270.0150.00417.40
7.3.260.0110.01516.46
7.3.250.0110.00816.72
7.3.240.0160.00916.54
7.3.230.0120.00916.75
7.3.210.0110.00716.82
7.3.200.0040.01819.39
7.3.190.0140.00416.78
7.3.180.0110.00616.32
7.3.170.0080.01716.59
7.3.160.0110.00716.57
7.2.330.0040.01316.92
7.2.320.0120.01017.00
7.2.310.0130.01316.99
7.2.300.0120.00616.84
7.2.290.0140.00416.93
5.4.320.0110.03212.63
5.4.310.0120.03212.63
5.4.300.0130.04612.63
5.4.290.0090.03812.62
5.4.280.0050.03812.51
5.4.270.0090.05012.51
5.4.260.0120.05012.51
5.4.250.0080.04412.51
5.4.240.0080.04912.51
5.4.230.0050.04412.50
5.4.220.0100.05212.50
5.4.210.0060.04412.50
5.4.200.0090.04612.50
5.4.190.0080.05412.49
5.4.180.0070.05512.50
5.4.170.0100.04712.51
5.4.160.0090.05112.50
5.4.150.0130.04612.50
5.4.140.0080.04012.18
5.4.130.0090.03512.16
5.4.120.0080.03912.13
5.4.110.0080.04312.12
5.4.100.0070.03812.12
5.4.90.0040.04912.12
5.4.80.0090.04712.12
5.4.70.0090.04012.12
5.4.60.0040.03812.12
5.4.50.0060.03612.11
5.4.40.0050.03712.10
5.4.30.0040.04212.10
5.4.20.0080.03712.10
5.4.10.0060.03612.09
5.4.00.0100.05011.59
5.3.290.0080.04312.90
5.3.280.0090.03812.81
5.3.270.0080.04612.82
5.3.260.0060.06112.81
5.3.250.0140.06412.81
5.3.240.0150.05312.81
5.3.230.0100.05012.80
5.3.220.0110.05012.77
5.3.210.0170.04612.78
5.3.200.0110.05312.77
5.3.190.0090.04512.77
5.3.180.0060.03912.77
5.3.170.0100.04012.77
5.3.160.0090.04312.77
5.3.150.0070.04112.77
5.3.140.0090.03712.76
5.3.130.0090.03812.76
5.3.120.0080.04212.75
5.3.110.0120.04912.75
5.3.100.0140.04512.24
5.3.90.0100.04912.23
5.3.80.0090.04812.21
5.3.70.0100.04612.21
5.3.60.0120.04712.19
5.3.50.0080.05312.14
5.3.40.0100.05612.14
5.3.30.0070.03912.11
5.3.20.0060.04111.89
5.3.10.0090.03811.85
5.3.00.0100.03811.84
5.2.170.0090.0439.34
5.2.160.0080.0459.34
5.2.150.0110.0409.34
5.2.140.0110.0489.33
5.2.130.0130.0459.29
5.2.120.0100.0479.29
5.2.110.0080.0449.30
5.2.100.0130.0409.30
5.2.90.0130.0469.29
5.2.80.0100.0469.29
5.2.70.0110.0439.29
5.2.60.0090.0409.24
5.2.50.0110.0429.21
5.2.40.0110.0429.19
5.2.30.0120.0429.17
5.2.20.0110.0439.15
5.2.10.0120.0419.09
5.2.00.0100.0408.94
5.1.60.0060.0388.23
5.1.50.0170.0368.23
5.1.40.0080.0418.21
5.1.30.0090.0458.55
5.1.20.0130.0468.57
5.1.10.0080.0398.30
5.1.00.0100.0378.29
5.0.50.0110.0286.78
5.0.40.0100.0286.64
5.0.30.0060.0486.46
5.0.20.0100.0256.43
5.0.10.0080.0316.41
5.0.00.0080.0416.39
4.4.90.0040.0274.78
4.4.80.0080.0214.76
4.4.70.0040.0224.75
4.4.60.0030.0194.75
4.4.50.0030.0214.77
4.4.40.0060.0364.71
4.4.30.0070.0204.76
4.4.20.0040.0244.84
4.4.10.0070.0214.85
4.4.00.0070.0324.76
4.3.110.0050.0234.67
4.3.100.0080.0194.67
4.3.90.0030.0234.63
4.3.80.0050.0334.59
4.3.70.0050.0204.63
4.3.60.0040.0204.63
4.3.50.0060.0184.63
4.3.40.0050.0244.54
4.3.30.0030.0273.27
4.3.20.0050.0223.26
4.3.10.0070.0193.22
4.3.00.0070.0176.86

preferences:
41.54 ms | 401 KiB | 5 Q