3v4l.org

run code in 300+ PHP versions simultaneously
<?php $nodes = '<air:AirPricingInfo Key="3T" TotalPrice="EUR328.98" BasePrice="EUR191.00" ApproximateTotalPrice="EUR328.98" ApproximateBasePrice="EUR191.00" Taxes="EUR137.98" LatestTicketingTime="2013-10-15T23:59:00.000+00:00" PricingMethod="Auto" PlatingCarrier="KL" ProviderCode="1P"> <air:FareInfo Key="13T" FareBasis="TWKNL" PassengerTypeCode="ADT" Origin="AMS" Destination="ROM" EffectiveDate="2013-10-08T17:49:20.621+02:00" Amount="NUC125.56"> <air:FareRuleKey FareInfoRef="13T" ProviderCode="1P">So05Ua7WWQ6LUnMVagmgWzIoZJ04F5ffjXmuoKjIAQzOW8SrBX6figwnZa5vZPwFnJN2p9gbxJQel+e1Y8YwIV8pQurxVP92</air:FareRuleKey> </air:FareInfo> <air:FareInfo Key="15T" FareBasis="TWKNL" PassengerTypeCode="ADT" Origin="ROM" Destination="AMS" EffectiveDate="2013-10-08T17:49:20.630+02:00" Amount="NUC125.56"> <air:FareRuleKey FareInfoRef="15T" ProviderCode="1P">So05Ua7WWQ6LUnMVagmgWzIoZJ04F5fflvTVZQjlKmjOW8SrBX6figwnZa5vZPwFnJN2p9gbxJQel+e1Y8YwIV8pQurxVP92</air:FareRuleKey> </air:FareInfo> <air:BookingInfo BookingCode="T" FareInfoRef="13T" SegmentRef="1T"/> <air:BookingInfo BookingCode="T" FareInfoRef="15T" SegmentRef="2T"/> <air:PassengerType Code="ADT" BookingTravelerRef="1"/> </air:AirPricingInfo> <air:AirPricingInfo Key="17T" TotalPrice="EUR275.52" BasePrice="EUR144.00" ApproximateTotalPrice="EUR275.52" ApproximateBasePrice="EUR144.00" Taxes="EUR131.52" LatestTicketingTime="2013-10-15T23:59:00.000+00:00" PricingMethod="Auto" PlatingCarrier="KL" ProviderCode="1P"> <air:FareInfo Key="27T" FareBasis="TWKNL" PassengerTypeCode="CNN" Origin="AMS" Destination="ROM" EffectiveDate="2013-10-08T17:49:20.653+02:00" Amount="NUC94.17"> <air:FareTicketDesignator Value="CH25"/> <air:FareRuleKey FareInfoRef="27T" ProviderCode="1P">So05Ua7WWQ6LUnMVagmgWzIoZJ04F5ffjXmuoKjIAQzOW8SrBX6figwnZa5vZPwFnJN2p9gbxJQel+e1Y8YwIV8pQurxVP92</air:FareRuleKey> </air:FareInfo> <air:FareInfo Key="29T" FareBasis="TWKNL" PassengerTypeCode="CNN" Origin="ROM" Destination="AMS" EffectiveDate="2013-10-08T17:49:20.655+02:00" Amount="NUC94.17"> <air:FareTicketDesignator Value="CH25"/> <air:FareRuleKey FareInfoRef="29T" ProviderCode="1P">So05Ua7WWQ6LUnMVagmgWzIoZJ04F5fflvTVZQjlKmjOW8SrBX6figwnZa5vZPwFnJN2p9gbxJQel+e1Y8YwIV8pQurxVP92</air:FareRuleKey> </air:FareInfo> <air:BookingInfo BookingCode="T" FareInfoRef="27T" SegmentRef="1T"/> <air:BookingInfo BookingCode="T" FareInfoRef="29T" SegmentRef="2T"/> <air:PassengerType Code="CNN" BookingTravelerRef="2"/> </air:AirPricingInfo> <air:AirPricingInfo Key="31T" TotalPrice="EUR19.00" BasePrice="EUR19.00" ApproximateTotalPrice="EUR19.00" ApproximateBasePrice="EUR19.00" Taxes="EUR0.00" LatestTicketingTime="2013-10-15T23:59:00.000+00:00" PricingMethod="Auto" PlatingCarrier="KL" ProviderCode="1P"> <air:FareInfo Key="32T" FareBasis="TWKNL" PassengerTypeCode="INF" Origin="AMS" Destination="ROM" EffectiveDate="2013-10-08T17:49:20.656+02:00" Amount="NUC12.55"> <air:FareTicketDesignator Value="IN90"/> <air:FareRuleKey FareInfoRef="32T" ProviderCode="1P">So05Ua7WWQ6LUnMVagmgWzIoZJ04F5ffjXmuoKjIAQzOW8SrBX6figwnZa5vZPwFnJN2p9gbxJQel+e1Y8YwIV8pQurxVP92</air:FareRuleKey> </air:FareInfo> <air:FareInfo Key="34T" FareBasis="TWKNL" PassengerTypeCode="INF" Origin="ROM" Destination="AMS" EffectiveDate="2013-10-08T17:49:20.657+02:00" Amount="NUC12.55"> <air:FareTicketDesignator Value="IN90"/> <air:FareRuleKey FareInfoRef="34T" ProviderCode="1P">So05Ua7WWQ6LUnMVagmgWzIoZJ04F5fflvTVZQjlKmjOW8SrBX6figwnZa5vZPwFnJN2p9gbxJQel+e1Y8YwIV8pQurxVP92</air:FareRuleKey> </air:FareInfo> <air:BookingInfo BookingCode="T" FareInfoRef="32T" SegmentRef="1T"/> <air:BookingInfo BookingCode="T" FareInfoRef="34T" SegmentRef="2T"/> <air:PassengerType Code="INF" BookingTravelerRef="3"/> </air:AirPricingInfo>'; $oMain = new DOMDocument(); $oMain->loadXml('<?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header/> <soapenv:Body> <air:AirCreateReservationReq xmlns:air="http://www.travelport.com/schema/air_v22_0" xmlns:com="http://www.travelport.com/schema/common_v19_0" AuthorizedBy="UAPI" TargetBranch="P7011033" ProviderCode="1P" Version="22"> <com:BillingPointOfSaleInfo OriginApplication="UAPI"/> <com:BookingTraveler DOB="1993-03-23" TravelerType="ADT" Key="1" Gender="M"> <com:BookingTravelerName First="Edo" Last="Rivai" Prefix="Dhr."/> <com:PhoneNumber Number="09007772228"/> </com:BookingTraveler> <com:BookingTraveler DOB="2008-05-05" TravelerType="CNN" Key="2" Gender="M"> <com:BookingTravelerName First="Bob" Last="stolk" Prefix="Dhr."/> <com:PhoneNumber Number="09007772228"/> </com:BookingTraveler> <com:BookingTraveler DOB="2013-01-01" TravelerType="INF" Key="3" Gender="M"> <com:BookingTravelerName First="Jens" Last="Steenhuis" Prefix="Dhr."/> <com:PhoneNumber Number="09007772228"/> </com:BookingTraveler> <air:AirPricingSolution Key="0T"> <air:AirSegment Key="1T" Group="0" Origin="AMS" Destination="FCO" Carrier="KL" FlightNumber="1609" ClassOfService="T" DepartureTime="2013-11-08T21:00:00.000+01:00" ArrivalTime="2013-11-08T23:10:00.000+01:00" ProviderCode="1P"/> <air:AirSegment Key="2T" Group="1" Origin="FCO" Destination="AMS" Carrier="KL" FlightNumber="1608" ClassOfService="T" DepartureTime="2013-11-30T21:15:00.000+01:00" ArrivalTime="2013-11-30T23:40:00.000+01:00" ProviderCode="1P"/> </air:AirPricingSolution> <com:ActionStatus Type="TAW" TicketDate="2013-10-09" ProviderCode="1P"/> </air:AirCreateReservationReq> </soapenv:Body> </soapenv:Envelope>'); $oAirPricingSolutionNode = $oMain->getElementsByTagName("AirPricingSolution")->item(0); $oNodesEncapsulated = new DOMDocument(); $oNodesEncapsulated->loadXml('<root><air:wrapper xmlns:common_v19_0="http://www.travelport.com/schema/common_v19_0" xmlns:air="http://www.travelport.com/schema/air_v22_0" TransactionId="98C211960A076113466F7BECF086E1DC" ResponseTime="4399">'.$nodes.'</air:wrapper></root>'); # Select all air:PricingInfo nodes $oAirPricingInfoNodes = $oNodesEncapsulated->getElementsByTagNameNs('http://www.travelport.com/schema/air_v22_0', 'AirPricingInfo'); # Check amount of nodes in selection if( ! $oAirPricingInfoNodes->length){ return FALSE; } # Loop over air:PricingInfo node selection foreach($oAirPricingInfoNodes as $oAirPricingInfoNode) { # Remove all nodes except the fareInfo nodes $oCurrentNode = $oAirPricingInfoNode->firstChild; while(NULL !== $oCurrentNode) { if (1 == $oCurrentNode->nodeType && "air:FareInfo" != $oCurrentNode->nodeName) { $oRemovable = $oCurrentNode; $oCurrentNode = $oCurrentNode->nextSibling; $oAirPricingInfoNode->removeChild($oRemovable); // echo $oCurrentNode->nodeName . "\n"; } else { $oCurrentNode = $oCurrentNode->nextSibling; } } $oAirPricingSolutionNode->firstChild->appendChild($oAirPricingSolutionNode->importNode($oAirPricingInfoNode, TRUE)); } echo $oMain->saveXml() . "\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.0070.01416.88
8.3.50.0120.00722.09
8.3.40.0150.00018.95
8.3.30.0190.00019.09
8.3.20.0080.00020.59
8.3.10.0050.00323.78
8.3.00.0090.00019.58
8.2.180.0160.00618.50
8.2.170.0150.00022.96
8.2.160.0140.00320.63
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0130.00626.16
8.2.120.0040.00421.21
8.2.110.0070.00321.41
8.2.100.0090.00318.22
8.2.90.0000.00819.56
8.2.80.0110.00019.73
8.2.70.0060.00317.88
8.2.60.0050.00318.18
8.2.50.0000.00818.59
8.2.40.0000.00820.85
8.2.30.0090.00019.49
8.2.20.0030.00518.04
8.2.10.0000.00818.50
8.2.00.0040.00418.12
8.1.280.0100.01025.92
8.1.270.0090.00024.09
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.01019.59
8.1.230.0040.00720.52
8.1.220.0030.00718.02
8.1.210.0040.00418.77
8.1.200.0090.00017.73
8.1.190.0060.00317.60
8.1.180.0040.00418.10
8.1.170.0000.00819.02
8.1.160.0040.00419.20
8.1.150.0040.00420.50
8.1.140.0060.00317.65
8.1.130.0040.00418.15
8.1.120.0070.00017.86
8.1.110.0000.00817.79
8.1.100.0000.00817.84
8.1.90.0070.00017.67
8.1.80.0000.00717.84
8.1.70.0070.00017.67
8.1.60.0030.00617.79
8.1.50.0040.00417.79
8.1.40.0030.00617.74
8.1.30.0030.00717.98
8.1.20.0030.00518.00
8.1.10.0080.00017.76
8.1.00.0050.00317.73
8.0.300.0040.00418.77
8.0.290.0040.00417.13
8.0.280.0000.00718.75
8.0.270.0040.00417.55
8.0.260.0000.00717.66
8.0.250.0000.00717.27
8.0.240.0030.00617.22
8.0.230.0000.00817.15
8.0.220.0000.00717.29
8.0.210.0000.00717.34
8.0.200.0030.00317.35
8.0.190.0000.00717.23
8.0.180.0020.00517.29
8.0.170.0030.00517.31
8.0.160.0040.00417.31
8.0.150.0020.00517.13
8.0.140.0000.00817.27
8.0.130.0030.00313.70
8.0.120.0040.00417.30
8.0.110.0030.00517.32
8.0.100.0040.00417.11
8.0.90.0070.00317.13
8.0.80.0060.00917.24
8.0.70.0040.00417.14
8.0.60.0000.00717.16
8.0.50.0030.00617.36
8.0.30.0130.00617.56
8.0.20.0070.01117.42
8.0.10.0000.00817.43
8.0.00.0110.01117.04
7.4.330.0000.00715.00
7.4.320.0050.00216.96
7.4.300.0000.00616.79
7.4.290.0070.00016.75
7.4.280.0040.00416.85
7.4.270.0030.00616.83
7.4.260.0000.00816.89
7.4.250.0070.00016.90
7.4.240.0040.00416.88
7.4.230.0040.00416.84
7.4.220.0090.00916.97
7.4.210.0070.00716.94
7.4.200.0030.00516.90
7.4.160.0080.00816.99
7.4.150.0150.00317.40
7.4.140.0100.01017.86
7.4.130.0090.01216.82
7.4.120.0140.00816.95
7.4.110.0060.01316.66
7.4.100.0090.00916.80
7.4.90.0110.00716.73
7.4.80.0160.00419.39
7.4.70.0030.01417.05
7.4.60.0060.01316.61
7.4.50.0040.00416.91
7.4.40.0070.01016.66
7.4.30.0100.00717.05
7.4.00.0110.00715.09
7.3.330.0000.00613.57
7.3.320.0030.00313.57
7.3.310.0070.00016.63
7.3.300.0000.00816.70
7.3.290.0070.00716.77
7.3.280.0100.00916.68
7.3.270.0120.00917.40
7.3.260.0100.01116.93
7.3.250.0070.01016.95
7.3.240.0120.00616.98
7.3.230.0070.01716.66
7.3.210.0100.01016.86
7.3.200.0040.01319.39
7.3.190.0130.01016.68
7.3.180.0130.00316.78
7.3.170.0170.00016.75
7.3.160.0140.00316.94
7.3.120.0090.00615.04
7.3.10.0040.01116.55
7.3.00.0070.00716.82
7.2.330.0090.00917.09
7.2.320.0170.00417.09
7.2.310.0030.01316.99
7.2.300.0000.01816.88
7.2.290.0140.00316.70
7.2.130.0030.01216.77
7.2.120.0030.01217.08
7.2.110.0060.00917.14
7.2.100.0090.00317.00
7.2.90.0060.01117.18
7.2.80.0130.00316.86
7.2.70.0100.01317.06
7.2.60.0060.00517.12
7.2.50.0130.00717.13
7.2.40.0090.01217.36
7.2.30.0060.01016.95
7.2.20.0130.00717.05
7.2.10.0030.01216.99
7.2.00.0020.00918.39
7.1.250.0060.00315.78
7.1.200.0080.00415.98
7.1.100.0050.00918.09
7.1.70.0060.00617.03
7.1.60.0100.01019.70
7.1.50.0110.01117.15
7.1.00.0000.08022.49
7.0.200.0000.01017.01
7.0.140.0030.07722.20
7.0.80.0330.04720.08
7.0.70.0330.04320.03
7.0.60.0270.04020.11
7.0.50.0230.06020.56
7.0.40.0100.04320.23
7.0.30.0170.03720.20
7.0.20.0070.05720.13
7.0.10.0070.06720.26
7.0.00.0000.04720.20
5.6.280.0070.07021.21
5.6.230.0030.04320.96
5.6.220.0030.04320.73
5.6.210.0000.04320.88
5.6.200.0070.04021.36
5.6.190.0070.08721.20
5.6.180.0030.06321.20
5.6.170.0130.05321.36
5.6.160.0000.04321.06
5.6.150.0200.07321.23
5.6.140.0070.08721.16
5.6.130.0230.07021.17
5.6.120.0030.05721.22
5.6.110.0070.09021.07
5.6.100.0130.08721.30
5.6.90.0300.03321.31
5.6.80.0130.08020.74
5.6.70.0030.05720.46
5.6.60.0070.08020.45
5.6.50.0130.05020.45
5.6.40.0100.07720.69
5.6.30.0130.05320.69
5.6.20.0100.08020.54
5.6.10.0070.08720.61
5.6.00.0130.07720.40
5.5.370.0000.04320.65
5.5.360.0000.04320.62
5.5.350.0130.06320.46
5.5.340.0100.03720.95
5.5.330.0070.05020.83
5.5.320.0030.04320.95
5.5.310.0070.05021.09
5.5.300.0170.07321.08
5.5.290.0070.06320.83
5.5.280.0170.06320.95
5.5.270.0000.08020.95
5.5.260.0000.06721.04
5.5.250.0100.07720.64
5.5.240.0100.08020.25
5.5.230.0030.08020.46
5.5.220.0030.04720.45
5.5.210.0070.04020.29
5.5.200.0100.07720.34
5.5.190.0170.07320.41
5.5.180.0130.07320.43
5.5.160.0100.07320.27
5.5.150.0130.06020.36
5.5.140.0070.07020.37
5.5.130.0070.07720.43
5.5.120.0000.06320.43
5.5.110.0100.06720.29
5.5.100.0130.06720.20
5.5.90.0130.06720.22
5.5.80.0000.08720.21
5.5.70.0070.08320.18
5.5.60.0130.05020.17
5.5.50.0070.05720.20
5.5.40.0070.08020.32
5.5.30.0030.07020.07
5.5.20.0070.08320.32
5.5.10.0170.07020.32
5.5.00.0100.08020.18
5.4.450.0130.06719.55
5.4.440.0030.06319.55
5.4.430.0070.08319.23
5.4.420.0170.06019.75
5.4.410.0000.06319.43
5.4.400.0070.08318.95
5.4.390.0200.06319.23
5.4.380.0000.08719.34
5.4.370.0200.06019.25
5.4.360.0130.07019.17
5.4.350.0030.07719.27
5.4.340.0030.07318.95
5.4.320.0170.07019.16
5.4.310.0100.07019.26
5.4.300.0070.04318.95
5.4.290.0070.07719.10
5.4.280.0130.07018.92
5.4.270.0000.08319.24
5.4.260.0100.07019.18
5.4.250.0070.07719.18
5.4.240.0130.06319.39
5.4.230.0000.06719.09
5.4.220.0130.07718.91
5.4.210.0130.06319.09
5.4.200.0100.07719.27
5.4.190.0030.04319.24
5.4.180.0130.06719.23
5.4.170.0100.08018.93
5.4.160.0070.08019.21
5.4.150.0030.07719.08
5.4.140.0100.07316.59
5.4.130.0070.06716.47
5.4.120.0030.06316.54
5.4.110.0030.05716.52
5.4.100.0030.05316.57
5.4.90.0100.06716.49
5.4.80.0100.08016.51
5.4.70.0130.07316.48
5.4.60.0070.07716.38
5.4.50.0130.06016.61
5.4.40.0100.07716.46
5.4.30.0100.05016.65
5.4.20.0030.05716.64
5.4.10.0030.04716.61
5.4.00.0100.07015.90
5.3.290.0000.07014.89
5.3.280.0070.05014.73
5.3.270.0100.08014.73
5.3.260.0030.05014.59
5.3.250.0100.04714.63
5.3.240.0030.06014.83
5.3.230.0000.04314.81
5.3.220.0170.06014.61
5.3.210.0200.05714.55
5.3.200.0100.05014.71
5.3.190.0030.04714.79
5.3.180.0130.06014.78
5.3.170.0130.04014.66
5.3.160.0100.07014.59
5.3.150.0070.07014.70
5.3.140.0200.04014.78
5.3.130.0000.04714.72
5.3.120.0200.06714.79
5.3.110.0070.07714.74
5.3.100.0030.05014.05
5.3.90.0130.04714.02
5.3.80.0070.07014.13
5.3.70.0100.03013.95
5.3.60.0000.04014.20
5.3.50.0130.07014.11
5.3.40.0100.03713.96
5.3.30.0030.03713.88
5.3.20.0070.06713.84
5.3.10.0100.05713.78
5.3.00.0030.07013.79
5.2.170.0070.06311.68
5.2.160.0030.06011.68
5.2.150.0000.06711.68
5.2.140.0000.06711.68
5.2.130.0070.06011.68
5.2.120.0000.05011.68
5.2.110.0100.05711.68
5.2.100.0070.04311.68
5.2.90.0030.06011.68
5.2.80.0100.05711.68
5.2.70.0100.05711.68
5.2.60.0030.04711.68
5.2.50.0030.02311.68
5.2.40.0030.03011.68
5.2.30.0030.05711.68
5.2.20.0070.02311.68
5.2.10.0030.06011.68
5.2.00.0000.02711.68
5.1.60.0000.05711.68
5.1.50.0130.04711.68
5.1.40.0030.04011.68
5.1.30.0070.02311.68
5.1.20.0070.02311.68
5.1.10.0070.02711.68
5.1.00.0100.05011.68
5.0.50.0000.03311.68
5.0.40.0030.03311.68
5.0.30.0070.05711.68
5.0.20.0030.03311.68
5.0.10.0030.02011.68
5.0.00.0030.05011.68
4.4.90.0000.03311.68
4.4.80.0000.01311.68
4.4.70.0000.01311.68
4.4.60.0000.03011.68
4.4.50.0030.02311.68
4.4.40.0070.03011.68
4.4.30.0000.02011.68
4.4.20.0000.03711.68
4.4.10.0070.03011.68
4.4.00.0030.03011.68
4.3.110.0000.02711.68
4.3.100.0000.02011.68
4.3.90.0070.03011.68
4.3.80.0000.02311.68
4.3.70.0070.01011.68
4.3.60.0000.02011.68
4.3.50.0000.03711.68
4.3.40.0000.05311.68
4.3.30.0000.03711.68
4.3.20.0030.01711.68
4.3.10.0030.03711.68
4.3.00.0000.03311.68

preferences:
48.6 ms | 401 KiB | 5 Q