3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlString = '<HybridSchedule> <matchNumber>1</matchNumber> <scoreBlueFinal>260</scoreBlueFinal> <scoreRedFinal>135</scoreRedFinal> <startTime>2017-03-25T10:30:00</startTime> <Teams> <Team> <station>Red1</station> <teamNumber>6514</teamNumber> </Team> <Team> <station>Red2</station> <teamNumber>1285</teamNumber> </Team> </Teams> </HybridSchedule>'; // If you have the XML as a string in a variable $xml = simplexml_load_string($xmlString); $teamNumber = null; foreach ($xml->Teams->Team as $team) { if ($team->station == 'Red1') { // We need to cast it as an int, or we're going to end up // with a "SimpleXMLElement"-object. $teamNumber = (int) $team->teamNumber; // We found our item, let's stop iterating break; } } echo $teamNumber;

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.0110.00619.27
8.5.20.0120.00719.72
8.5.10.0100.00818.50
8.5.00.0140.00720.10
8.4.180.0050.00525.84
8.4.170.0100.01123.94
8.4.160.0160.00822.37
8.4.150.0070.00516.89
8.4.140.0200.00917.52
8.4.130.0110.00918.89
8.4.120.0130.00717.74
8.4.110.0110.00919.99
8.4.100.0110.01018.09
8.4.90.0100.01020.65
8.4.80.0120.00819.00
8.4.70.0060.00518.89
8.4.60.0130.00619.24
8.4.50.0150.00520.30
8.4.40.0130.00619.47
8.4.30.0000.02217.60
8.4.20.0060.00317.61
8.4.10.0090.00317.82
8.3.300.0140.00620.30
8.3.290.0110.00920.99
8.3.280.0110.00920.40
8.3.270.0110.00816.65
8.3.260.0130.00616.65
8.3.250.0120.00816.94
8.3.240.0100.00916.74
8.3.230.0130.00716.70
8.3.220.0090.01019.13
8.3.210.0130.00716.67
8.3.200.0050.00416.55
8.3.190.0100.00917.33
8.3.180.0090.00919.30
8.3.170.0100.00921.09
8.3.160.0070.01118.41
8.3.150.0040.00417.25
8.3.140.0100.00720.73
8.3.130.0090.00018.64
8.3.120.0000.01019.20
8.3.110.0060.00320.94
8.3.100.0030.00616.66
8.3.90.0110.00726.77
8.3.80.0030.00617.97
8.3.70.0120.00318.43
8.3.60.0120.00918.55
8.3.50.0040.00916.78
8.3.40.0070.00718.79
8.3.30.0080.00818.88
8.3.20.0040.00420.46
8.3.10.0080.00023.78
8.3.00.0080.00023.86
8.2.300.0120.00822.32
8.2.290.0130.00616.87
8.2.280.0120.00818.56
8.2.270.0130.00618.44
8.2.260.0040.01117.25
8.2.250.0030.00616.58
8.2.240.0100.00616.66
8.2.230.0090.00322.58
8.2.220.0030.00624.06
8.2.210.0110.00726.77
8.2.200.0080.00018.54
8.2.190.0090.00916.75
8.2.180.0160.00018.54
8.2.170.0110.00422.96
8.2.160.0070.00720.60
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00022.39
8.2.120.0000.00726.35
8.2.110.0000.01022.37
8.2.100.0090.00317.97
8.2.90.0050.00319.38
8.2.80.0080.00417.97
8.2.70.0000.00817.75
8.2.60.0050.00318.05
8.2.50.0000.00818.28
8.2.40.0060.00320.72
8.2.30.0000.00821.18
8.2.20.0060.00318.16
8.2.10.0040.00418.28
8.2.00.0040.00418.33
8.1.340.0100.01223.43
8.1.330.0150.00416.20
8.1.320.0110.00917.69
8.1.310.0100.01017.24
8.1.300.0030.00618.48
8.1.290.0030.00630.84
8.1.280.0120.00625.92
8.1.270.0000.00923.90
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0050.00522.41
8.1.230.0110.00017.89
8.1.220.0050.00317.91
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0060.00317.22
8.1.180.0050.00318.10
8.1.170.0030.00518.70
8.1.160.0040.00418.98
8.1.150.0040.00419.04
8.1.140.0000.00717.92
8.1.130.0050.00219.06
8.1.120.0050.00317.51
8.1.110.0050.00517.55
8.1.100.0000.00717.59
8.1.90.0040.00417.68
8.1.80.0000.00817.64
8.1.70.0040.00417.55
8.1.60.0040.00417.68
8.1.50.0000.00817.80
8.1.40.0040.00417.63
8.1.30.0060.00317.94
8.1.20.0040.00417.89
8.1.10.0040.00417.71
8.1.00.0050.00217.66
8.0.300.0070.00018.77
8.0.290.0030.00617.00
8.0.280.0070.00018.49
8.0.270.0040.00417.05
8.0.260.0000.00716.93
8.0.250.0000.00717.07
8.0.240.0050.00217.05
8.0.230.0070.00017.10
8.0.220.0040.00417.00
8.0.210.0030.00317.14
8.0.200.0050.00217.12
8.0.190.0000.00917.05
8.0.180.0000.00717.07
8.0.170.0000.00717.12
8.0.160.0070.00017.14
8.0.150.0040.00416.87
8.0.140.0050.00317.13
8.0.130.0060.00013.50
8.0.120.0050.00217.02
8.0.110.0080.00017.08
8.0.100.0000.00716.88
8.0.90.0040.00417.11
8.0.80.0060.00917.03
8.0.70.0050.00316.89
8.0.60.0000.00716.97
8.0.50.0030.00317.12
8.0.30.0120.00917.24
8.0.20.0110.01017.46
8.0.10.0040.00417.16
8.0.00.0080.01116.81
7.4.330.0000.00516.95
7.4.320.0030.00316.80
7.4.300.0060.00016.74
7.4.290.0000.00716.82
7.4.280.0050.00216.73
7.4.270.0030.00316.64
7.4.260.0040.00716.69
7.4.250.0030.00616.79
7.4.240.0030.00316.80
7.4.230.0000.00716.74
7.4.220.0090.01316.64
7.4.210.0040.01216.91
7.4.200.0000.00716.82
7.4.150.0110.01117.40
7.4.140.0110.00717.86
7.4.130.0120.00616.83
7.4.120.0110.00716.67
7.4.110.0130.00716.95
7.4.100.0150.00316.77
7.4.90.0140.00916.62
7.4.80.0140.00419.39
7.4.70.0090.00916.68
7.4.60.0040.01116.76
7.4.50.0070.01116.56
7.4.40.0140.00716.77
7.4.30.0030.01316.57
7.4.00.0110.00415.02
7.3.330.0000.00613.31
7.3.320.0000.00513.19
7.3.310.0030.00316.52
7.3.300.0070.00016.42
7.3.290.0070.00716.47
7.3.280.0090.00716.46
7.3.270.0120.00917.40
7.3.260.0050.01216.71
7.3.250.0130.00916.57
7.3.240.0120.00616.53
7.3.230.0160.00016.71
7.3.210.0070.01116.57
7.3.200.0120.00616.60
7.3.190.0090.00616.48
7.3.180.0030.01316.67
7.3.170.0030.01316.54
7.3.160.0040.01216.69
7.2.330.0090.00917.02
7.2.320.0060.01116.80
7.2.310.0100.01016.97
7.2.300.0030.01316.76
7.2.290.0140.00716.83
7.2.60.0150.01217.15
7.1.200.0100.00316.04
7.1.110.0060.01418.25
7.1.100.0050.00818.32
7.1.90.0070.00718.19
7.1.80.0070.01018.38
7.1.70.0060.00817.35
7.1.60.0190.01334.99
7.1.50.0180.01835.00
7.1.40.0210.01234.45
7.1.30.0200.01934.68
7.1.20.0250.01334.64
7.1.10.0110.00816.61
7.1.00.0070.01016.70
7.0.250.0060.01217.86
7.0.240.0030.01017.67
7.0.230.0100.00717.79
7.0.220.0090.00618.05
7.0.210.0000.01416.81
7.0.200.0060.01016.77
7.0.190.0110.00616.86
7.0.180.0110.00716.36
7.0.170.0060.01216.38
7.0.160.0040.01416.59
7.0.150.0070.00716.33
7.0.140.0060.00916.33
7.0.130.0120.00316.60
7.0.120.0030.01516.67
7.0.110.0030.01016.50
7.0.100.0030.00916.63
7.0.90.0040.01116.43
7.0.80.0090.00616.67
7.0.70.0090.01116.42
7.0.60.0070.01016.29
7.0.50.0030.01216.61
7.0.40.0040.01116.57
7.0.30.0000.01416.67
7.0.20.0030.01316.50
7.0.10.0090.00616.53
7.0.00.0060.00916.57

preferences:
113.04 ms | 1465 KiB | 5 Q