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->appendChild($oMain->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.0150.00618.93
8.3.50.0090.01222.17
8.3.40.0090.00618.88
8.3.30.0120.00619.09
8.3.20.0050.00320.75
8.3.10.0080.00021.20
8.3.00.0040.00424.03
8.2.180.0110.00417.00
8.2.170.0120.00322.96
8.2.160.0100.00320.95
8.2.150.0030.00624.18
8.2.140.0050.00324.66
8.2.130.0060.00326.16
8.2.120.0080.00021.26
8.2.110.0090.00320.88
8.2.100.0000.01218.09
8.2.90.0050.00319.50
8.2.80.0050.00319.66
8.2.70.0060.00318.00
8.2.60.0000.00918.30
8.2.50.0030.00518.07
8.2.40.0050.00318.48
8.2.30.0000.00719.82
8.2.20.0040.00418.10
8.2.10.0000.00818.12
8.2.00.0030.00618.12
8.1.280.0060.01225.92
8.1.270.0070.00023.99
8.1.260.0120.00626.35
8.1.250.0080.00028.09
8.1.240.0030.00724.22
8.1.230.0070.00421.26
8.1.220.0000.00818.77
8.1.210.0040.00419.22
8.1.200.0030.00717.63
8.1.190.0030.00517.87
8.1.180.0040.00418.10
8.1.170.0000.00819.00
8.1.160.0050.00319.32
8.1.150.0040.00419.07
8.1.140.0080.00017.90
8.1.130.0000.00718.26
8.1.120.0040.00417.80
8.1.110.0040.00417.84
8.1.100.0000.00717.91
8.1.90.0000.00717.79
8.1.80.0030.00517.84
8.1.70.0000.00717.85
8.1.60.0040.00417.89
8.1.50.0030.00517.81
8.1.40.0000.00917.99
8.1.30.0030.00517.94
8.1.20.0000.00917.93
8.1.10.0050.00218.04
8.1.00.0080.00017.82
8.0.300.0000.00820.38
8.0.290.0070.00017.55
8.0.280.0000.00718.75
8.0.270.0040.00417.67
8.0.260.0070.00017.18
8.0.250.0000.00817.23
8.0.240.0040.00417.21
8.0.230.0040.00417.37
8.0.220.0000.00717.16
8.0.210.0000.00717.31
8.0.200.0000.00717.39
8.0.190.0080.00017.40
8.0.180.0000.00817.41
8.0.170.0040.00417.21
8.0.160.0100.00017.29
8.0.150.0070.00217.22
8.0.140.0040.00417.27
8.0.130.0070.00013.80
8.0.120.0050.00317.26
8.0.110.0060.00317.37
8.0.100.0040.00417.07
8.0.90.0060.00317.38
8.0.80.0100.00717.25
8.0.70.0050.00317.36
8.0.60.0040.00417.20
8.0.50.0000.00817.33
8.0.30.0120.00917.43
8.0.20.0080.01117.42
8.0.10.0080.00017.41
8.0.00.0080.01517.28
7.4.330.0000.00617.04
7.4.320.0040.00416.81
7.4.300.0000.00716.96
7.4.290.0050.00216.79
7.4.280.0070.00416.98
7.4.270.0040.00416.96
7.4.260.0030.00313.65
7.4.250.0040.00416.93
7.4.240.0080.00016.98
7.4.230.0000.00717.00
7.4.220.0070.01416.96
7.4.210.0090.00916.90
7.4.200.0050.00316.96
7.4.190.0030.00717.06
7.4.160.0120.00616.79
7.4.150.0070.01117.40
7.4.140.0120.01117.86
7.4.130.0100.00916.83
7.4.120.0120.00916.81
7.4.110.0070.01316.73
7.4.100.0110.00716.95
7.4.90.0030.01616.90
7.4.80.0030.01819.39
7.4.70.0090.01317.07
7.4.60.0070.01117.01
7.4.50.0000.00816.70
7.4.40.0110.00522.77
7.4.30.0110.01116.98
7.4.00.0080.00815.16
7.3.330.0050.00013.39
7.3.320.0030.00313.58
7.3.310.0040.00416.76
7.3.300.0040.00416.74
7.3.290.0050.01016.70
7.3.280.0130.00416.76
7.3.270.0090.00917.40
7.3.260.0070.01418.24
7.3.250.0080.00916.83
7.3.240.0180.00016.82
7.3.230.0110.00716.89
7.3.210.0070.01016.76
7.3.200.0070.01119.39
7.3.190.0070.01116.80
7.3.180.0080.00816.66
7.3.170.0100.01016.60
7.3.160.0130.00316.85
7.3.120.0130.00315.29
7.3.110.0090.00915.18
7.3.100.0030.01414.98
7.3.90.0090.00314.85
7.3.80.0000.01415.21
7.3.70.0000.01315.07
7.3.60.0060.00614.94
7.3.50.0030.01215.00
7.3.40.0060.00915.29
7.3.30.0080.00815.07
7.3.20.0140.00316.90
7.3.10.0050.00716.78
7.3.00.0080.00516.74
7.2.330.0100.01016.91
7.2.320.0120.00617.19
7.2.310.0120.00617.21
7.2.300.0100.01017.11
7.2.290.0130.00417.13
7.2.240.0070.00314.98
7.2.230.0100.00715.29
7.2.220.0100.00715.36
7.2.210.0000.01415.42
7.2.200.0030.00915.28
7.2.190.0060.00615.22
7.2.180.0000.01315.31
7.2.170.0070.00715.34
7.2.160.0110.00415.25
7.2.150.0080.00617.07
7.2.140.0110.00417.20
7.2.130.0040.00816.98
7.2.120.0020.01017.04
7.2.110.0050.01017.17
7.2.100.0070.00617.08
7.2.90.0020.00917.07
7.2.80.0080.00717.12
7.2.70.0060.01017.10
7.2.60.0070.00517.10
7.2.50.0070.00817.13
7.2.40.0040.01217.17
7.2.30.0040.01017.14
7.2.20.0070.00917.10
7.2.10.0060.00917.17
7.2.00.0100.00817.77
7.1.330.0040.01115.84
7.1.320.0000.01616.06
7.1.310.0030.01016.04
7.1.300.0000.00815.96
7.1.290.0030.00916.04
7.1.280.0140.00015.98
7.1.270.0070.00415.82
7.1.260.0080.00416.11
7.1.250.0100.00416.00
7.1.200.0030.00615.96
7.1.100.0000.01417.95
7.1.70.0070.00717.24
7.1.60.0040.00817.20
7.1.50.0030.00917.17
7.1.00.0030.07322.63
7.0.200.0000.00816.91
7.0.140.0030.07322.20
7.0.100.0170.07320.31
7.0.90.0130.08320.29
7.0.80.0100.08720.28
7.0.70.0070.08320.28
7.0.60.0130.06720.14
7.0.50.0070.08020.45
7.0.40.0130.07320.29
7.0.30.0170.04320.32
7.0.20.0100.08020.29
7.0.10.0030.08320.32
7.0.00.0100.07020.31
5.6.280.0030.07321.17
5.6.250.0030.06020.84
5.6.240.0130.08020.91
5.6.230.0030.06720.76
5.6.220.0100.07320.78
5.6.210.0000.05320.97
5.6.200.0070.08321.13
5.6.190.0100.08321.23
5.6.180.0070.08021.10
5.6.170.0170.07021.17
5.6.160.0130.04721.33
5.6.150.0030.05721.39
5.6.140.0030.05321.11
5.6.130.0030.04721.25
5.6.120.0130.04021.12
5.6.110.0030.05321.36
5.6.100.0070.04021.18
5.6.90.0030.04321.27
5.6.80.0100.05320.62
5.6.70.0070.07020.70
5.6.60.0070.06720.61
5.6.50.0100.06020.56
5.6.40.0030.04320.62
5.6.30.0030.04020.56
5.6.20.0070.05320.63
5.6.10.0070.05020.60
5.6.00.0130.04720.60
5.5.380.0100.04320.57
5.5.370.0200.07020.73
5.5.360.0070.04320.57
5.5.350.0070.08320.70
5.5.340.0100.06721.18
5.5.330.0100.08321.03
5.5.320.0070.08721.12
5.5.310.0100.08021.11
5.5.300.0070.06721.09
5.5.290.0000.06020.91
5.5.280.0070.05021.11
5.5.270.0100.03720.91
5.5.260.0070.04020.97
5.5.250.0070.03720.80
5.5.240.0030.04320.50
5.5.230.0030.03720.38
5.5.220.0070.03720.52
5.5.210.0070.03320.43
5.5.200.0070.03720.40
5.5.190.0030.05720.49
5.5.180.0030.04320.47
5.5.160.0070.03720.24
5.5.150.0000.04320.44
5.5.140.0000.07720.30
5.5.130.0070.03320.48
5.5.120.0130.04720.39
5.5.110.0100.03320.34
5.5.100.0000.06720.35
5.5.90.0170.02320.39
5.5.80.0200.05020.14
5.5.70.0070.03720.34
5.5.60.0030.04020.23
5.5.50.0070.03720.36
5.5.40.0070.03720.34
5.5.30.0100.06020.07
5.5.20.0030.05320.33
5.5.10.0070.03320.26
5.5.00.0030.04320.27
5.4.450.0000.05319.63
5.4.440.0170.03019.62
5.4.430.0070.03319.77
5.4.420.0000.04319.53
5.4.410.0070.04019.46
5.4.400.0030.03719.31
5.4.390.0030.04019.31
5.4.380.0030.05319.21
5.4.370.0100.06318.98
5.4.360.0030.03719.22
5.4.350.0000.05019.23
5.4.340.0070.05019.11
5.4.320.0070.07019.12
5.4.310.0070.04319.30
5.4.300.0000.04019.21
5.4.290.0000.04019.27
5.4.280.0100.04019.09
5.4.270.0030.03719.29
5.4.260.0100.03019.29
5.4.250.0070.05719.30
5.4.240.0070.03319.27
5.4.230.0000.04019.26
5.4.220.0100.04719.20
5.4.210.0030.03719.28
5.4.200.0070.08019.31
5.4.190.0000.04019.19
5.4.180.0030.03719.41
5.4.170.0000.04019.19
5.4.160.0070.06719.23
5.4.150.0130.06719.26
5.4.140.0130.06716.50
5.4.130.0100.07016.52
5.4.120.0030.07316.59
5.4.110.0070.07016.73
5.4.100.0170.06716.63
5.4.90.0070.07316.73
5.4.80.0030.07716.63
5.4.70.0000.05016.70
5.4.60.0100.06716.60
5.4.50.0130.06316.60
5.4.40.0100.07016.41
5.4.30.0030.04316.37
5.4.20.0070.06316.62
5.4.10.0070.07316.75
5.4.00.0030.07316.05
5.3.290.0000.04014.86
5.3.280.0100.08014.76
5.3.270.0030.04314.85
5.3.260.0070.03714.79
5.3.250.0130.06314.84
5.3.240.0100.07714.80
5.3.230.0030.08014.77
5.3.220.0200.06314.85
5.3.210.0030.08014.73
5.3.200.0070.07014.77
5.3.190.0000.05014.74
5.3.180.0170.05314.73
5.3.170.0100.07314.81
5.3.160.0130.07014.60
5.3.150.0100.07314.72
5.3.140.0030.08314.80
5.3.130.0100.07714.60
5.3.120.0100.07014.79
5.3.110.0100.07714.75
5.3.100.0000.05014.30
5.3.90.0070.07314.19
5.3.80.0030.08014.21
5.3.70.0100.04314.27
5.3.60.0000.08314.27
5.3.50.0130.07014.00
5.3.40.0130.07013.99
5.3.30.0000.06314.16
5.3.20.0100.07313.87
5.3.10.0130.07013.87
5.3.00.0030.07713.59
5.2.170.0070.06311.33
5.2.160.0070.06711.33
5.2.150.0100.05711.18
5.2.140.0130.05711.41
5.2.130.0000.05711.42
5.2.120.0100.05011.34
5.2.110.0130.05311.29
5.2.100.0030.06311.28
5.2.90.0100.06011.30
5.2.80.0130.05011.40
5.2.70.0030.06311.27
5.2.60.0070.05711.37
5.2.50.0030.06711.13
5.2.40.0000.06711.26
5.2.30.0000.07011.23
5.2.20.0030.07011.11
5.2.10.0070.05311.16
5.2.00.0030.06010.95
5.1.60.0030.05710.29
5.1.50.0000.04010.18
5.1.40.0030.05710.21
5.1.30.0000.04310.66
5.1.20.0070.05310.62
5.1.10.0070.05310.33
5.1.00.0070.05310.28
5.0.50.0000.0508.98
5.0.40.0070.0408.98
5.0.30.0030.0638.98
5.0.20.0070.0308.98
5.0.10.0070.0408.98
5.0.00.0030.0578.98
4.4.90.0000.0208.98
4.4.80.0100.0308.98
4.4.70.0030.0338.98
4.4.60.0070.0238.98
4.4.50.0030.0378.98
4.4.40.0070.0508.98
4.4.30.0000.0238.98
4.4.20.0070.0208.98
4.4.10.0030.0378.98
4.4.00.0000.0578.98
4.3.110.0030.0338.98
4.3.100.0030.0338.98
4.3.90.0000.0408.98
4.3.80.0030.0508.98
4.3.70.0000.0338.98
4.3.60.0000.0408.98
4.3.50.0000.0338.98
4.3.40.0000.0338.98
4.3.30.0000.0378.98
4.3.20.0000.0408.98
4.3.10.0030.0378.98
4.3.00.0000.0338.98

preferences:
36.67 ms | 401 KiB | 5 Q