3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = <<<XML <?xml version="1.0" encoding="UTF-8" ?> <root> <ARTICLEDATA> <ARTICLE> <A_PRICEDATA> <A_PRICE channel="1" currency="EUR"> <A_VK>34.95</A_VK> </A_PRICE> </A_PRICEDATA> <A_MEDIADATA> <A_MEDIA type="image" origname="9990.jpg">https://1.jpg</A_MEDIA> <A_MEDIA type="image" origname="11260.jpg">https://2.jpg</A_MEDIA> <A_MEDIA type="image" origname="12294.jpg">https://3.jpg</A_MEDIA> <A_MEDIA type="image" origname="13306.jpg">https://4.jpg</A_MEDIA> <A_MEDIA type="image" origname="13012.jpg">https://5.jpg</A_MEDIA> <A_MEDIA type="image" origname="13760.jpg">https://6.jpg</A_MEDIA> </A_MEDIADATA> </ARTICLE> <ARTICLE> <A_PRICEDATA> <A_PRICE channel="1" currency="EUR"> <A_VK>19.95</A_VK> </A_PRICE> </A_PRICEDATA> <A_MEDIADATA> <A_MEDIA type="image" origname="9990.jpg">https://10.jpg</A_MEDIA> <A_MEDIA type="image" origname="11260.jpg">https://2.jpg</A_MEDIA> <A_MEDIA type="image" origname="12294.jpg">https://3.jpg</A_MEDIA> <A_MEDIA type="image" origname="13306.jpg">https://4.jpg</A_MEDIA> <A_MEDIA type="image" origname="13012.jpg">https://5.jpg</A_MEDIA> <A_MEDIA type="image" origname="13760.jpg">https://6.jpg</A_MEDIA> </A_MEDIADATA> </ARTICLE> </ARTICLEDATA> </root> XML; $xml = simplexml_load_string($str); $articles = ""; foreach ($xml->ARTICLEDATA->ARTICLE as $article) { $price = (string)$article->A_PRICEDATA->A_PRICE->A_VK; $firstImage = (string)$article->A_MEDIADATA->A_MEDIA[0]; $produkt = "Product 1"; $articles .= '<div class="photo"><img src="' . $firstImage . '" style="width: 120px margin:5px;"><div class="product-info mt__15"><h3 class="product-title pr fs__14 mg__0 fwm">' . $produkt . '</h3><span class="price">€' . $price . ' EUR</span></div></div>'; } echo $articles;

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.70.0090.00818.75
8.5.60.0110.00717.02
8.5.50.0080.01117.01
8.5.30.0090.00919.12
8.5.20.0100.00719.64
8.5.10.0130.00817.10
8.5.00.0140.00820.46
8.4.210.0060.00319.66
8.4.180.0130.00824.20
8.4.170.0110.01122.43
8.4.160.0070.01624.07
8.4.150.0070.00716.98
8.4.140.0150.00917.79
8.4.130.0100.01118.84
8.4.120.0150.00618.14
8.4.110.0030.00620.04
8.4.100.0150.00617.88
8.4.90.0120.00720.83
8.4.80.0030.00519.23
8.4.70.0070.00818.96
8.4.60.0110.00918.89
8.4.50.0100.01018.96
8.4.40.0130.00317.82
8.4.30.0160.00320.57
8.4.20.0030.00619.56
8.4.10.0070.01318.02
8.3.300.0120.00520.71
8.3.290.0090.01018.70
8.3.280.0080.01418.52
8.3.270.0100.01116.97
8.3.260.0130.00816.71
8.3.250.0110.00916.81
8.3.240.0090.00816.84
8.3.230.0030.00516.88
8.3.220.0070.01119.41
8.3.210.0120.01018.63
8.3.200.0090.00616.68
8.3.190.0060.00319.04
8.3.180.0110.00816.87
8.3.170.0130.00620.79
8.3.160.0130.00717.23
8.3.150.0130.00619.19
8.3.140.0040.01517.32
8.3.130.0050.00318.60
8.3.120.0060.00319.20
8.3.110.0030.00620.94
8.3.100.0100.00317.02
8.3.90.0080.00026.77
8.3.80.0030.00617.00
8.3.70.0040.01217.00
8.3.60.0140.00016.96
8.3.50.0100.01018.45
8.3.40.0080.00619.42
8.3.30.0090.00619.04
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.300.0120.00718.93
8.2.290.0160.00217.14
8.2.280.0120.00818.70
8.2.270.0070.00317.55
8.2.260.0120.00316.82
8.2.250.0050.00316.91
8.2.240.0050.00517.47
8.2.230.0040.00422.58
8.2.220.0000.01624.06
8.2.210.0030.00626.77
8.2.200.0040.00416.88
8.2.190.0120.00617.00
8.2.180.0040.01125.92
8.2.170.0200.00019.16
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0060.00919.86
8.2.110.0070.00321.37
8.2.100.0040.00818.16
8.2.90.0040.00419.46
8.2.80.0000.00818.18
8.2.70.0040.00418.00
8.2.60.0030.00618.17
8.2.50.0050.00318.07
8.2.40.0050.00320.13
8.2.30.0070.00018.32
8.2.20.0050.00219.62
8.2.10.0040.00419.04
8.2.00.0030.00519.63
8.1.340.0140.00817.77
8.1.330.0130.00616.40
8.1.320.0120.00718.17
8.1.310.0070.01116.37
8.1.300.0090.00018.60
8.1.290.0060.00330.84
8.1.280.0120.00625.92
8.1.270.0110.00324.21
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0040.00822.27
8.1.230.0110.00023.00
8.1.220.0090.00017.90
8.1.210.0040.00418.77
8.1.200.0060.00317.48
8.1.190.0090.00017.37
8.1.180.0060.00618.10
8.1.170.0000.00918.83
8.1.160.0000.00719.02
8.1.150.0040.00418.88
8.1.140.0080.00017.71
8.1.130.0000.00719.02
8.1.120.0070.00017.73
8.1.110.0040.00417.55
8.1.100.0000.00717.70
8.1.90.0040.00417.56
8.1.80.0000.00717.69
8.1.70.0040.00417.69
8.1.60.0080.00017.86
8.1.50.0000.00817.66
8.1.40.0030.00517.77
8.1.30.0000.00817.90
8.1.20.0000.00817.79
8.1.10.0050.00317.70
8.1.00.0070.00017.55
8.0.300.0040.00418.77
8.0.290.0040.00417.00
8.0.280.0050.00318.60
8.0.270.0030.00517.11
8.0.260.0030.00318.70
8.0.250.0040.00417.34
8.0.240.0080.00017.13
8.0.230.0000.00717.19
8.0.220.0080.00017.26
8.0.210.0020.00517.28
8.0.200.0030.00317.20
8.0.190.0000.00817.29
8.0.180.0040.00417.14
8.0.170.0030.00617.24
8.0.160.0040.00417.16
8.0.150.0040.00417.08
8.0.140.0000.00717.21
8.0.130.0000.00613.57
8.0.120.0030.00617.07
8.0.110.0000.00817.19
8.0.100.0040.00416.97
8.0.90.0020.00517.19
8.0.80.0000.00817.24
8.0.70.0000.00817.00
8.0.60.0000.00717.00
8.0.50.0000.00717.10
8.0.30.0040.00417.13
8.0.20.0030.00517.19
8.0.10.0040.00417.20
8.0.00.0000.00917.28
7.4.330.0050.00015.55
7.4.320.0030.00316.74
7.4.300.0000.00716.71
7.4.290.0040.00416.70
7.4.280.0070.00016.70
7.4.270.0000.00716.74
7.4.260.0000.00513.43
7.4.250.0050.00316.63
7.4.240.0030.00516.64
7.4.230.0030.00516.86
7.4.220.0000.00816.77
7.4.210.0080.00016.71
7.4.200.0000.00716.74
7.4.190.0080.00016.80
7.4.180.0050.00316.89
7.4.160.0000.00716.86
7.4.150.0050.00316.61
7.4.140.0040.00416.68
7.4.130.0080.00016.77
7.4.120.0000.00716.70
7.4.110.0040.00416.61
7.4.100.0000.00716.68
7.4.90.0030.00316.65
7.4.80.0030.00316.68
7.4.70.0070.00016.58
7.4.60.0000.00716.70
7.4.50.0070.00016.60
7.4.40.0070.00016.61
7.4.30.0000.00716.54
7.4.20.0040.00416.61
7.4.10.0030.00316.64
7.4.00.0020.00516.81
7.3.330.0000.00716.52
7.3.320.0000.00513.55
7.3.310.0000.00716.43
7.3.300.0060.00316.45
7.3.290.0040.00416.65
7.3.280.0040.00416.70
7.3.270.0030.00316.48
7.3.260.0070.00016.69
7.3.250.0000.00716.68
7.3.240.0030.00316.45
7.3.230.0030.00316.64
7.3.220.0030.00316.36
7.3.210.0030.00316.63
7.3.200.0070.00016.46
7.3.190.0000.00716.55
7.3.180.0000.00716.57
7.3.170.0040.00416.56
7.3.160.0000.00716.60
7.3.150.0070.00016.39
7.3.140.0030.00316.62
7.3.130.0030.00316.38
7.3.120.0040.00416.59
7.3.110.0040.00416.40
7.3.100.0080.00016.30
7.3.90.0080.00016.86
7.3.80.0000.00716.41
7.3.70.0000.00716.67
7.3.60.0070.00016.71
7.3.50.0070.00016.49
7.3.40.0030.00316.45
7.3.30.0000.00716.46
7.3.20.0000.00718.38
7.3.10.0000.00718.24
7.3.00.0000.00718.22

preferences:
29.34 ms | 1491 KiB | 5 Q