3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlstr = '<?xml version="1.0"?> <catalog> <car> <title>This is car</title> <price>44.95</price> <model>2018</model> <description>An in-depth look at creating applications with XML.</description> </car> <bike> <title>this is bike</title> <price>33.58</price> <description>Just the dummy description</description> </bike> <wheels> <title>this is wheel</title> <price>33.58</price> <description>Just the dummy description</description> </wheels> <bike> <title>this is bike</title> <price>33.58</price> <description>Just the dummy description</description> </bike> </catalog>'; $xml = simplexml_load_string($xmlstr); foreach ($xml->children() as $product) { if ($product->getName() == 'car') { carFunc($product->title, $product->price, $product->model, $product->description); } if ($product->getName() == 'bike') { bikeFunc($product->title, $product->price, $product->description); } if ($product->getName() == 'wheels') { wheelFunc($product->title, $product->price, $product->description); } } function carFunc($title, $price, $model, $description) { echo "Car: $title: It's a $model selling for $price. In detail: $description\n"; } function bikeFunc($title, $price, $description) { echo "Bike: $title: It sells for $price. In detail: $description\n"; } function wheelFunc($title, $price, $description) { echo "Wheel: $title: It sells for $price. In detail: $description\n"; }

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.0130.00718.55
8.3.50.0140.00717.49
8.3.40.0040.01518.84
8.3.30.0100.00618.98
8.3.20.0000.00722.02
8.3.10.0090.00019.10
8.3.00.0040.00422.02
8.2.180.0130.00725.92
8.2.170.0100.00619.08
8.2.160.0100.00322.96
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00426.16
8.2.110.0080.00420.58
8.2.100.0090.00318.02
8.2.90.0030.00520.85
8.2.80.0040.00418.29
8.2.70.0030.00618.16
8.2.60.0080.00018.34
8.2.50.0080.00018.10
8.2.40.0000.00819.50
8.2.30.0000.00719.45
8.2.20.0020.00518.19
8.2.10.0000.00819.02
8.2.00.0040.00419.89
8.1.280.0120.00625.92
8.1.270.0090.00022.07
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00322.72
8.1.230.0070.00421.20
8.1.220.0030.00618.16
8.1.210.0100.00019.23
8.1.200.0040.00817.73
8.1.190.0040.00417.60
8.1.180.0060.00318.10
8.1.170.0000.00818.78
8.1.160.0050.00319.14
8.1.150.0000.00819.04
8.1.140.0000.00719.09
8.1.130.0040.00417.76
8.1.120.0050.00317.67
8.1.110.0000.00817.55
8.1.100.0050.00317.66
8.1.90.0040.00417.70
8.1.80.0080.00017.69
8.1.70.0070.00317.59
8.1.60.0030.00617.85
8.1.50.0050.00317.74
8.1.40.0000.00917.72
8.1.30.0000.00817.72
8.1.20.0030.00617.94
8.1.10.0040.00417.64
8.1.00.0040.00417.74
8.0.300.0000.00720.44
8.0.290.0030.00517.00
8.0.280.0000.00718.63
8.0.270.0000.00717.04
8.0.260.0060.00317.05
8.0.250.0000.00717.09
8.0.240.0000.00917.17
8.0.230.0030.00317.20
8.0.220.0040.00417.18
8.0.210.0070.00017.11
8.0.200.0070.00017.11
8.0.190.0000.00817.20
8.0.180.0040.00417.06
8.0.170.0080.00417.14
8.0.160.0080.00017.11
8.0.150.0040.00417.21
8.0.140.0040.00417.08
8.0.130.0030.00313.53
8.0.120.0040.00417.06
8.0.110.0050.00217.15
8.0.100.0040.00416.98
8.0.90.0000.00717.01
8.0.80.0060.00917.13
8.0.70.0000.00717.19
8.0.60.0070.00017.02
8.0.50.0050.00317.27
8.0.30.0110.00717.29
8.0.20.0160.01317.59
8.0.10.0040.00417.14
8.0.00.0080.01217.13
7.4.330.0000.00515.55
7.4.320.0060.00016.86
7.4.300.0070.00016.62
7.4.290.0030.00516.75
7.4.280.0000.00816.68
7.4.270.0070.00016.77
7.4.260.0070.00016.79
7.4.250.0000.00816.59
7.4.240.0080.00016.72
7.4.230.0030.00316.78
7.4.220.0030.00516.95
7.4.210.0040.01116.90
7.4.200.0030.00316.64
7.4.130.0070.01016.62
7.4.120.0110.00916.79
7.4.110.0150.00316.77
7.4.100.0100.00616.87
7.4.90.0080.01116.55
7.4.80.0110.00819.39
7.4.70.0150.00316.58
7.4.60.0110.00716.70
7.4.50.0100.00716.51
7.4.40.0130.00316.79
7.4.00.0020.01515.01
7.3.330.0000.00513.53
7.3.320.0000.00613.46
7.3.310.0030.00316.57
7.3.300.0030.00316.49
7.3.290.0030.00316.35
7.3.280.0080.00716.51
7.3.260.0100.00816.61
7.3.240.0130.00716.66
7.3.230.0080.01416.70
7.3.210.0130.00816.91
7.3.200.0100.01316.68
7.3.190.0090.01216.55
7.3.180.0100.00616.51
7.3.170.0130.00316.75
7.3.160.0030.02016.88
7.3.120.0040.01514.80
7.3.110.0110.00714.87
7.3.100.0090.00914.80
7.3.90.0100.00715.16
7.3.80.0060.00915.28
7.3.70.0050.00514.57
7.3.60.0070.00314.85
7.3.50.0080.00814.99
7.3.40.0080.00414.79
7.3.30.0110.00414.90
7.3.20.0100.00616.09
7.3.10.0060.00816.10
7.3.00.0080.00716.22
7.2.330.0120.01216.91
7.2.320.0130.00316.73
7.2.310.0140.00317.02
7.2.300.0120.00416.89
7.2.290.0080.00816.81
7.2.250.0040.01415.06
7.2.240.0030.01315.36
7.2.230.0030.01215.29
7.2.220.0000.01415.32
7.2.210.0000.01115.26
7.2.200.0090.00614.90
7.2.190.0090.00315.20
7.2.180.0100.00415.26
7.2.170.0040.01115.06
7.2.160.0090.00515.21
7.2.150.0100.00716.35
7.2.140.0090.00516.32
7.2.130.0090.00416.44
7.2.120.0100.01016.40
7.2.110.0090.00816.51
7.2.100.0050.01016.27
7.2.90.0040.01116.37
7.2.80.0090.00616.43
7.2.70.0060.01016.35
7.2.60.0120.00716.44
7.2.50.0090.00816.59
7.2.40.0090.01016.48
7.2.30.0070.01316.47
7.2.20.0090.00416.24
7.2.10.0070.00716.31
7.2.00.0370.00516.44
7.1.330.0090.00916.00
7.1.320.0070.00715.78
7.1.310.0090.00315.79
7.1.300.0030.01015.72
7.1.290.0060.00915.89
7.1.280.0040.00715.29
7.1.270.0060.00715.36
7.1.260.0090.00815.34
7.1.250.0080.00615.32
7.1.240.0090.01216.02
7.1.230.0070.01015.90
7.1.220.0100.00515.64
7.1.210.0090.00615.97
7.1.200.0120.01216.01
7.1.190.0020.00915.69
7.1.180.0040.01215.85
7.1.170.0070.00715.84
7.1.160.0090.00615.77
7.1.150.0130.00415.85
7.1.140.0120.00615.85
7.1.130.0120.00515.69
7.1.120.0070.00715.76
7.1.110.0130.00315.95
7.1.100.0050.01115.90
7.1.90.0090.00715.93
7.1.80.0020.01015.88
7.1.70.0070.00815.98
7.1.60.0070.00715.86
7.1.50.0090.00515.90
7.1.40.0070.00515.85
7.1.30.0080.00715.90
7.1.20.0080.00615.94
7.1.10.0070.00715.91
7.1.00.0030.00815.91
7.0.330.0100.00515.39
7.0.320.0160.00315.51
7.0.310.0110.01115.44
7.0.300.0230.00615.57
7.0.290.0130.00815.55
7.0.280.0160.00015.45
7.0.270.0130.01015.37
7.0.260.0220.00315.40
7.0.250.0160.01615.61
7.0.240.0090.01615.40
7.0.230.0140.00415.45
7.0.220.0090.00615.48
7.0.210.0080.01715.49
7.0.200.0150.00315.41
7.0.190.0100.00815.55
7.0.180.0180.00715.52
7.0.170.0180.00915.47
7.0.160.0120.00915.40
7.0.150.0060.01915.62
7.0.140.0180.00715.34
7.0.130.0050.01515.45
7.0.120.0140.00915.58
7.0.110.0110.00715.42
7.0.100.0110.00615.41
7.0.90.0130.01015.53
7.0.80.0260.00615.35
7.0.70.0060.01215.38
7.0.60.0150.00615.42
7.0.50.0080.00915.52
7.0.40.0130.00615.23
7.0.30.0070.01515.08
7.0.20.0130.01715.45
7.0.10.0190.00815.54
7.0.00.0220.00415.57
5.6.400.0130.01114.23
5.6.390.0150.00813.96
5.6.380.0150.00714.05
5.6.370.0090.02214.33
5.6.360.0150.00514.52
5.6.350.0160.00614.57
5.6.340.0180.01514.55
5.6.330.0200.00713.96
5.6.320.0150.00814.37
5.6.310.0200.01514.59
5.6.300.0110.01014.31
5.6.290.0170.01314.48
5.6.280.0230.00314.34
5.6.270.0080.01214.18
5.6.260.0130.00714.56
5.6.250.0130.01314.43
5.6.240.0170.00714.30
5.6.230.0100.01614.42
5.6.220.0140.00714.05
5.6.210.0200.01014.28
5.6.200.0190.01014.14
5.6.190.0080.00814.10
5.6.180.0200.00514.35
5.6.170.0190.01414.34
5.6.160.0120.00414.45
5.6.150.0170.00714.53
5.6.140.0140.00714.23
5.6.130.0240.00614.52
5.6.120.0130.00414.35
5.6.110.0120.01214.40
5.6.100.0040.01214.50
5.6.90.0190.00914.70
5.6.80.0250.00014.23
5.6.70.0140.00614.49
5.6.60.0180.01114.35
5.6.50.0190.00614.38
5.6.40.0140.00714.28
5.6.30.0200.00914.62
5.6.20.0050.01514.14
5.6.10.0170.01714.31
5.6.00.0260.00614.30
5.5.380.0100.00514.52
5.5.370.0070.01814.34
5.5.360.0040.01113.95
5.5.350.0100.01714.46
5.5.340.0170.00714.13
5.5.330.0130.01014.47
5.5.320.0210.01214.17
5.5.310.0170.00914.23
5.5.300.0230.00914.47
5.5.290.0150.00314.29
5.5.280.0150.00414.05
5.5.270.0100.01513.96
5.5.260.0150.01014.28
5.5.250.0140.00914.23
5.5.240.0040.01214.29
5.5.230.0210.00314.34
5.5.220.0210.01114.42
5.5.210.0240.00914.25
5.5.200.0130.01514.52
5.5.190.0210.00313.89
5.5.180.0190.00714.52
5.5.170.0240.00314.41
5.5.160.0170.01514.14
5.5.150.0120.01114.22
5.5.140.0160.00314.23
5.5.130.0190.01114.23
5.5.120.0150.00514.45
5.5.110.0130.00614.34
5.5.100.0080.00814.41
5.5.90.0160.00614.25
5.5.80.0090.01614.38
5.5.70.0140.00214.25
5.5.60.0100.01314.03
5.5.50.0230.00714.25
5.5.40.0130.01214.30
5.5.30.0090.01814.41
5.5.20.0150.00914.09
5.5.10.0150.00914.22
5.5.00.0110.00814.02
5.4.450.0030.00911.20
5.4.440.0170.00310.93
5.4.430.0080.00310.88
5.4.420.0070.00410.96
5.4.410.0170.00610.91
5.4.400.0000.01110.76
5.4.390.0120.00611.40
5.4.380.0060.01110.86
5.4.370.0040.00811.01
5.4.360.0110.00710.93
5.4.350.0070.01410.98
5.4.340.0060.00910.70
5.4.330.0000.00911.12
5.4.320.0110.00610.75
5.4.310.0070.00410.74
5.4.300.0100.00211.01
5.4.290.0080.01211.13
5.4.280.0140.00210.98
5.4.270.0090.00510.91
5.4.260.0100.00710.99
5.4.250.0120.00910.92
5.4.240.0060.01010.79
5.4.230.0120.00410.76
5.4.220.0080.01110.68
5.4.210.0040.00910.91
5.4.200.0110.00511.31
5.4.190.0060.00611.07
5.4.180.0070.00910.85
5.4.170.0070.00510.53
5.4.160.0030.00810.88
5.4.150.0000.01111.26
5.4.140.0150.00411.26
5.4.130.0100.00511.04
5.4.120.0060.01011.16
5.4.110.0090.00210.92
5.4.100.0100.00510.95
5.4.90.0110.00311.13
5.4.80.0030.00910.62
5.4.70.0030.00911.07
5.4.60.0140.00710.86
5.4.50.0100.00310.86
5.4.40.0040.00811.07
5.4.30.0000.01111.20
5.4.20.0090.00411.06
5.4.10.0070.00710.74
5.4.00.0110.00810.89
5.3.290.0080.00810.54
5.3.280.0080.00010.58
5.3.270.0100.01010.46
5.3.260.0050.00510.48
5.3.250.0030.00810.48
5.3.240.0070.00410.59
5.3.230.0040.00710.65
5.3.220.0070.00710.29
5.3.210.0040.00710.46
5.3.200.0070.01110.28
5.3.190.0060.00610.52
5.3.180.0070.00310.67
5.3.170.0130.00710.71
5.3.160.0090.00310.66
5.3.150.0090.00310.66
5.3.140.0030.01610.59
5.3.130.0130.00410.71
5.3.120.0050.00510.42
5.3.110.0030.01110.70
5.3.100.0050.00510.71
5.3.90.0130.00510.82
5.3.80.0080.00010.64
5.3.70.0030.00710.53
5.3.60.0050.00510.71
5.3.50.0080.00310.60
5.3.40.0110.00210.60
5.3.30.0080.00310.73
5.3.20.0170.00010.54
5.3.10.0040.00410.44
5.3.00.0120.00610.41
5.2.170.0070.0049.91
5.2.160.0090.0059.91
5.2.150.0030.0129.91
5.2.140.0170.0009.91
5.2.130.0040.0129.91
5.2.120.0060.0069.91
5.2.110.0100.0079.91
5.2.100.0030.0149.91
5.2.90.0070.0059.91
5.2.80.0070.0079.91
5.2.70.0000.0109.91
5.2.60.0120.0089.91
5.2.50.0120.0069.91
5.2.40.0050.0109.91
5.2.30.0100.0079.91
5.2.20.0050.0059.91
5.2.10.0040.0089.91
5.2.00.0070.0039.91
5.1.60.0050.0059.91
5.1.50.0110.0049.91
5.1.40.0090.0039.91
5.1.30.0120.0069.91
5.1.20.0100.0059.91
5.1.10.0070.0079.91
5.1.00.0030.0069.91
5.0.50.0030.0099.91
5.0.40.0100.0009.91
5.0.30.0080.0059.91
5.0.20.0030.0069.91
5.0.10.0090.0039.91
5.0.00.0090.0009.91
4.4.90.0040.0079.91
4.4.80.0020.0079.91
4.4.70.0000.0119.91
4.4.60.0080.0049.91
4.4.50.0000.0099.91
4.4.40.0070.0079.91
4.4.30.0090.0039.91
4.4.20.0070.0049.91
4.4.10.0030.0059.91
4.4.00.0070.0049.91
4.3.110.0040.0089.91
4.3.100.0050.0069.91
4.3.90.0000.0049.91
4.3.80.0090.0039.91
4.3.70.0050.0059.91
4.3.60.0080.0049.91
4.3.50.0070.0039.91
4.3.40.0030.0069.91
4.3.30.0000.0089.91
4.3.20.0080.0039.91
4.3.10.0050.0059.91
4.3.00.0040.0089.91

preferences:
62.42 ms | 401 KiB | 5 Q