3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<?xml version='1.0' encoding='ISO-8859-1'?> <delta> <history> <detail> <id>one</id> <degree> <dname>alpha</dname> <dates> <StartDate> <Year>1998</Year> </StartDate> <EndDate> <Year>2002</Year> </EndDate> </dates> </degree> </detail> <detail> <id>two</id> <degree> <dname>beta</dname> <dates> <StartDate> <Year>2006</Year> </StartDate> <EndDate> <Year>2008</Year> </EndDate> </dates> </degree> </detail> </history> </delta>"; $doc = new DOMDocument; $doc->preserveWhiteSpace = false; $doc->loadXML($xml); $xpath = new DOMXPath($doc); $items = $doc->getElementsByTagName("detail"); $subitemarray = array(); $icounter = 0; foreach ($items as $item) { $query = "//dates"; //xpath of all occurrence of Year $entries = $xpath->query($query, $item); foreach ($entries as $entry) { $startDate = $entry->getElementsByTagName("StartDate")[0]->nodeValue; $endDate = $entry->getElementsByTagName("EndDate")[0]->nodeValue; $dates["startdate"] = $startDate; //extract StartDate $dates["enddate"] = $endDate; //extract EndDate } $subitemarray[$icounter++] = $dates; } var_dump($subitemarray);

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.01017.25
8.5.00.0160.00720.56
8.4.150.0010.00114.05
8.4.140.0140.00817.87
8.4.130.0120.00819.03
8.4.120.0150.00519.24
8.4.110.0160.00519.37
8.4.100.0110.01118.20
8.4.90.0100.01020.87
8.4.80.0060.00321.01
8.4.70.0100.01119.25
8.4.60.0120.01020.90
8.4.50.0070.01518.96
8.4.40.0050.00517.98
8.4.30.0080.00019.71
8.4.20.0030.00720.94
8.4.10.0100.01018.00
8.3.280.0180.00718.86
8.3.270.0120.00817.31
8.3.260.0130.00717.33
8.3.250.0090.01017.70
8.3.240.0160.00416.98
8.3.230.0070.00916.85
8.3.220.0130.00519.41
8.3.210.0100.00617.26
8.3.200.0050.00417.02
8.3.190.0070.00317.66
8.3.180.0140.00519.39
8.3.170.0070.01117.59
8.3.160.0180.00018.70
8.3.150.0110.01417.52
8.3.140.0070.01117.66
8.3.130.0080.00018.77
8.3.120.0090.00019.50
8.3.110.0070.01320.94
8.3.100.0030.00624.06
8.3.90.0040.00426.77
8.3.80.0050.00518.93
8.3.70.0080.00818.93
8.3.60.0120.00918.80
8.3.50.0120.00517.80
8.3.40.0000.01519.13
8.3.30.0070.00719.08
8.3.20.0080.00022.16
8.3.10.0040.01123.94
8.3.00.0000.00820.06
8.2.290.0090.00817.36
8.2.280.0110.00820.41
8.2.270.0170.00317.00
8.2.260.0100.00017.34
8.2.250.0000.00817.50
8.2.240.0000.01117.64
8.2.230.0060.00322.58
8.2.220.0040.00437.54
8.2.210.0090.00626.77
8.2.200.0030.00616.88
8.2.190.0040.01117.00
8.2.180.0070.01118.86
8.2.170.0070.00722.96
8.2.160.0040.01121.64
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00019.69
8.2.120.0040.00426.35
8.2.110.0070.00322.75
8.2.100.0060.00618.03
8.2.90.0000.00818.38
8.2.80.0040.00418.13
8.2.70.0040.00418.30
8.2.60.0040.00418.54
8.2.50.0080.00018.66
8.2.40.0080.00020.85
8.2.30.0090.00019.66
8.2.20.0040.00418.46
8.2.10.0040.00418.62
8.2.00.0050.00318.50
8.1.330.0130.00616.52
8.1.320.0120.00816.60
8.1.310.0060.00317.07
8.1.300.0130.00316.47
8.1.290.0060.00330.84
8.1.280.0060.00925.92
8.1.270.0040.00422.64
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0090.00022.75
8.1.230.0060.00621.40
8.1.220.0040.00418.16
8.1.210.0000.00819.38
8.1.200.0030.00617.86
8.1.190.0000.00817.72
8.1.180.0050.00318.10
8.1.170.0000.00819.08
8.1.160.0000.00719.32
8.1.150.0000.00720.82
8.1.140.0000.00718.17
8.1.130.0080.00019.61
8.1.120.0050.00217.72
8.1.110.0040.00417.73
8.1.100.0000.01017.96
8.1.90.0050.00217.93
8.1.80.0040.00417.91
8.1.70.0060.00317.93
8.1.60.0060.00617.84
8.1.50.0040.00418.03
8.1.40.0080.00017.86
8.1.30.0050.00317.95
8.1.20.0030.00617.95
8.1.10.0040.00417.89
8.1.00.0000.00717.97
8.0.300.0020.00520.45
8.0.290.0000.00816.99
8.0.280.0050.00318.80
8.0.270.0000.00717.59
8.0.260.0030.00617.13
8.0.250.0000.00717.20
8.0.240.0000.00817.43
8.0.230.0080.00017.41
8.0.220.0050.00217.35
8.0.210.0030.00317.21
8.0.200.0030.00317.32
8.0.190.0060.00317.28
8.0.180.0080.00017.42
8.0.170.0060.00617.23
8.0.160.0040.00417.41
8.0.150.0050.00217.22
8.0.140.0060.00317.23
8.0.130.0060.00013.81
8.0.120.0060.00317.35
8.0.110.0020.00517.14
8.0.100.0070.00017.26
8.0.90.0050.00217.23
8.0.80.0130.00717.36
8.0.70.0000.00717.27
8.0.60.0050.00317.25
8.0.50.0030.00617.23
8.0.30.0100.01017.59
8.0.20.0080.01117.45
8.0.10.0040.00417.23
8.0.00.0110.00617.21
7.4.330.0000.00515.55
7.4.320.0030.00317.01
7.4.300.0000.00617.01
7.4.290.0080.00016.94
7.4.280.0040.00416.88
7.4.270.0000.00716.99
7.4.260.0000.00816.97
7.4.250.0000.00717.00
7.4.240.0030.00317.02
7.4.230.0000.00816.80
7.4.220.0040.00417.07
7.4.210.0130.00616.83
7.4.200.0000.00716.99
7.4.150.0140.00617.40
7.4.140.0130.00617.86
7.4.130.0090.00916.88
7.4.120.0120.00916.98
7.4.110.0110.00616.83
7.4.100.0110.00516.80
7.4.90.0060.01217.09
7.4.80.0090.01619.39
7.4.70.0070.01116.89
7.4.60.0100.00716.95
7.4.50.0110.00316.84
7.4.40.0140.00316.76
7.4.00.0070.00715.15
7.3.330.0050.00013.46
7.3.320.0000.00613.64
7.3.310.0070.00016.81
7.3.300.0000.00616.72
7.3.290.0100.00816.65
7.3.280.0060.01316.74
7.3.270.0110.00617.40
7.3.260.0110.01016.79
7.3.240.0130.00616.87
7.3.230.0150.00316.69
7.3.210.0030.01416.96
7.3.200.0170.00316.92
7.3.190.0100.00716.73
7.3.180.0060.01116.61
7.3.170.0110.00716.83
7.3.160.0090.00716.61
7.3.10.0070.01116.73
7.3.00.0120.00616.57
7.2.330.0060.01216.79
7.2.320.0060.01517.31
7.2.310.0090.00917.13
7.2.300.0100.00717.08
7.2.290.0060.01217.09
7.2.130.0030.01417.21
7.2.120.0100.01316.88
7.2.110.0140.00316.68
7.2.100.0140.00716.66
7.2.90.0120.00916.79
7.2.80.0170.00316.65
7.2.70.0100.01016.63
7.2.60.0100.00917.04
7.2.50.0200.00417.04
7.2.40.0140.00916.78
7.2.30.0200.00417.04
7.2.20.0120.01418.48
7.2.10.0150.01018.55
7.2.00.0140.01118.54
7.1.250.0160.00315.72
7.1.200.0040.00715.94
7.1.140.0160.01218.47
7.1.130.0110.01218.73
7.1.120.0080.01618.75
7.1.110.0100.01518.36
7.1.100.0110.01318.39
7.1.90.0160.01418.45
7.1.80.0090.01218.43
7.1.70.0080.01317.08
7.1.60.0230.01835.22
7.1.50.0250.01435.13
7.1.40.0300.01534.51
7.1.30.0320.01734.67
7.1.20.0290.01434.76
7.1.10.0090.01216.76
7.1.00.0090.00817.02

preferences:
44.66 ms | 403 KiB | 5 Q