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->preserveWhiteSpace = false; $oMain->formatOutput = true; $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.70.0110.00717.00
8.3.60.0130.00317.11
8.3.50.0260.00717.55
8.3.40.0130.01019.30
8.3.30.0070.00719.17
8.3.20.0080.00018.85
8.3.10.0080.00019.11
8.3.00.0030.00619.75
8.2.180.0080.00816.75
8.2.170.0060.00922.96
8.2.160.0170.00019.29
8.2.150.0050.00324.18
8.2.140.0070.01024.66
8.2.130.0080.00026.16
8.2.120.0040.00421.37
8.2.110.0100.00021.49
8.2.100.0040.00818.09
8.2.90.0000.00818.59
8.2.80.0050.00318.53
8.2.70.0030.00618.00
8.2.60.0080.00018.00
8.2.50.0040.00418.30
8.2.40.0000.00819.72
8.2.30.0090.00018.00
8.2.20.0040.00818.01
8.2.10.0030.00518.13
8.2.00.0030.00518.20
8.1.280.0120.00325.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0110.00424.11
8.1.230.0110.00023.14
8.1.220.0030.00618.14
8.1.210.0050.00319.03
8.1.200.0110.00017.60
8.1.190.0080.00317.72
8.1.180.0000.00818.10
8.1.170.0000.00819.26
8.1.160.0000.00819.48
8.1.150.0030.00519.14
8.1.140.0040.00417.86
8.1.130.0050.00217.88
8.1.120.0020.00517.90
8.1.110.0050.00317.94
8.1.100.0040.00417.89
8.1.90.0000.00817.91
8.1.80.0000.00717.94
8.1.70.0050.00217.91
8.1.60.0080.00017.90
8.1.50.0040.00417.84
8.1.40.0030.00617.90
8.1.30.0030.00618.06
8.1.20.0080.00018.08
8.1.10.0080.00018.06
8.1.00.0000.00817.81
8.0.300.0040.00420.40
8.0.290.0050.00417.10
8.0.280.0000.00818.93
8.0.270.0070.00017.64
8.0.260.0040.00417.21
8.0.250.0040.00717.26
8.0.240.0050.00217.22
8.0.230.0040.00417.17
8.0.220.0070.00017.33
8.0.210.0070.00017.14
8.0.200.0000.00717.39
8.0.190.0040.00417.44
8.0.180.0040.00417.20
8.0.170.0060.00317.25
8.0.160.0040.00417.17
8.0.150.0030.00617.27
8.0.140.0050.00317.25
8.0.130.0060.00013.74
8.0.120.0060.00317.27
8.0.110.0040.00417.21
8.0.100.0050.00217.33
8.0.90.0040.00417.13
8.0.80.0160.00317.23
8.0.70.0040.00417.15
8.0.60.0040.00417.15
8.0.50.0040.00417.14
8.0.30.0130.00317.74
8.0.20.0150.00917.61
8.0.10.0000.00817.26
8.0.00.0120.01717.18
7.4.330.0000.00513.34
7.4.320.0030.00316.94
7.4.300.0070.00016.88
7.4.290.0030.00616.98
7.4.280.0060.00316.96
7.4.270.0000.00716.88
7.4.260.0000.00613.70
7.4.250.0030.00617.04
7.4.240.0000.00716.90
7.4.230.0000.00816.92
7.4.220.0120.00616.88
7.4.210.0060.01617.09
7.4.200.0000.00716.91
7.4.190.0030.00617.07
7.4.160.0080.00817.02
7.4.150.0060.01316.92
7.4.140.0230.00317.86
7.4.130.0110.01117.00
7.4.120.0060.01216.90
7.4.110.0060.01416.89
7.4.100.0030.01617.00
7.4.90.0060.01316.87
7.4.80.0030.01619.39
7.4.70.0120.00617.09
7.4.60.0100.00716.83
7.4.50.0030.00616.58
7.4.40.0060.00916.71
7.4.30.0110.00517.07
7.4.00.0110.00615.27
7.3.330.0040.00313.41
7.3.320.0030.00313.55
7.3.310.0040.00416.56
7.3.300.0040.00416.73
7.3.290.0090.00616.74
7.3.280.0060.01416.76
7.3.270.0170.00616.64
7.3.260.0090.00916.80
7.3.240.0070.01016.80
7.3.230.0030.01416.99
7.3.210.0040.01216.77
7.3.200.0110.00816.74
7.3.190.0110.01216.83
7.3.180.0070.01016.81
7.3.170.0030.01316.69
7.3.160.0150.00316.67
7.3.120.0070.00815.22
7.3.110.0120.00614.82
7.3.100.0120.00615.21
7.3.90.0060.00915.14
7.3.80.0030.01314.92
7.3.70.0000.00915.06
7.3.60.0060.00914.97
7.3.50.0100.00715.20
7.3.40.0060.00315.04
7.3.30.0000.01415.20
7.3.20.0110.00416.95
7.3.10.0090.00316.98
7.3.00.0030.01216.90
7.2.330.0120.00617.16
7.2.320.0140.01117.16
7.2.310.0120.00617.25
7.2.300.0060.01016.88
7.2.290.0150.00317.05
7.2.250.0070.01315.28
7.2.240.0030.01714.85
7.2.230.0060.01215.28
7.2.220.0090.00614.98
7.2.210.0100.00715.43
7.2.200.0080.00315.38
7.2.190.0000.01415.19
7.2.180.0070.00715.26
7.2.170.0040.00815.23
7.2.60.0110.00317.05
7.2.00.0060.00919.71
7.1.330.0000.01516.11
7.1.320.0120.00015.74
7.1.310.0100.00316.04
7.1.300.0060.00316.03
7.1.290.0060.01016.12
7.1.280.0030.01016.18
7.1.270.0000.01216.09
7.1.260.0000.01415.88
7.1.200.0100.00715.98
7.1.100.0030.00618.11
7.1.70.0070.00417.28
7.1.60.0090.01519.25
7.1.50.0170.01034.77
7.1.00.0000.04022.63
7.0.200.0050.00316.87
7.0.140.0130.06322.26
7.0.120.0100.07022.24
7.0.60.0130.06720.14
7.0.50.0030.04018.09
7.0.40.0000.09720.35
7.0.30.0600.06720.32
7.0.20.0370.08020.16
7.0.10.0170.04320.30
7.0.00.0000.05020.44
5.6.280.0070.09321.44
5.6.210.0030.07720.71
5.6.200.0030.05718.32
5.6.190.0130.05320.68
5.6.180.0230.05720.59
5.6.170.0200.04720.66
5.6.160.0170.08020.60
5.6.150.0100.05318.33
5.6.140.0070.05018.34
5.6.130.0000.04718.33
5.6.120.0100.08021.23
5.6.110.0070.08721.31
5.6.100.0130.06021.30
5.6.90.0100.06721.26
5.6.80.0070.07020.69
5.6.70.3930.03720.66
5.5.350.0200.04720.64
5.5.340.0130.07718.18
5.5.330.0070.04020.38
5.5.320.0230.04020.59
5.5.310.0100.04720.48
5.5.300.0130.07318.20
5.5.290.0100.08718.17
5.5.280.0030.07321.02
5.5.270.0030.07320.98
5.5.260.0000.04721.19
5.5.250.0230.06720.93
5.5.240.0130.06020.37
5.4.450.0400.04319.42
5.4.440.0500.04319.74
5.4.430.1000.04319.38
5.4.420.0600.03719.57
5.4.410.0400.02719.40
5.4.400.0670.04019.21
5.4.390.0570.03319.36
5.4.380.0330.08019.33
5.4.370.0770.04019.22
5.4.360.0600.04319.29
5.4.350.0430.03719.09
5.4.340.0230.04719.38
5.4.320.0300.05019.41
5.4.310.0200.07019.23
5.4.300.0300.04719.21
5.4.290.0600.03719.06
5.4.280.0330.04719.20
5.4.270.1030.04319.38
5.4.260.0630.04719.06
5.4.250.0470.04719.38
5.4.240.0430.04319.40
5.4.230.0670.04319.10
5.4.220.0530.04719.05
5.4.210.0600.04019.32
5.4.200.0600.03319.11
5.4.190.0630.04019.38
5.4.180.0800.03319.19
5.4.170.0830.03719.20
5.4.160.0170.03719.37
5.4.150.1070.03019.34
5.4.140.0830.03016.50
5.4.130.0400.03716.66
5.4.120.0630.03316.64
5.4.110.0630.03316.50
5.4.100.0730.03716.66
5.4.90.0530.03016.53
5.4.80.0570.03016.46
5.4.70.0600.03016.66
5.4.60.0330.04716.38
5.4.50.0470.04316.57
5.4.40.0270.03716.57
5.4.30.0570.03016.66
5.4.20.0100.04316.61
5.4.10.0530.03716.68
5.4.00.0270.04316.19
5.3.290.0370.05316.20
5.3.280.0630.05016.19
5.3.270.0700.04016.19
5.3.260.0670.05716.19
5.3.250.0570.03716.19
5.3.240.0400.03716.19
5.3.230.0730.03316.19
5.3.220.0670.03716.19
5.3.210.0870.04716.19
5.3.200.0570.03316.19
5.3.190.0400.04016.19
5.3.180.0370.03716.19
5.3.170.0530.04316.19
5.3.160.0430.04316.19
5.3.150.0330.03716.19
5.3.140.0630.04716.19
5.3.130.0670.04016.19
5.3.120.0500.03716.19
5.3.110.0730.03316.19
5.3.100.0530.04016.19
5.3.90.0800.03016.19
5.3.80.0430.04316.19
5.3.70.0600.04316.19
5.3.60.0830.05716.19
5.3.50.0500.03016.19
5.3.40.0800.03716.19
5.3.30.0800.04316.19
5.3.20.0430.05316.19
5.3.10.0830.03016.19
5.3.00.0400.03716.19
5.2.170.0500.03316.19
5.2.160.0330.03316.19
5.2.150.0300.03716.19
5.2.140.0530.03316.19
5.2.130.0670.02716.19
5.2.120.0630.02016.19
5.2.110.0470.04016.19
5.2.100.0300.04716.19
5.2.90.0430.03016.19
5.2.80.0400.03716.19
5.2.70.0370.02716.19
5.2.60.0500.02716.19
5.2.50.0500.03316.19
5.2.40.0270.03016.19
5.2.30.0300.03316.19
5.2.20.0430.02716.19
5.2.10.0600.03716.19
5.2.00.0330.04016.19
5.1.60.0500.02016.19
5.1.50.0130.03016.19
5.1.40.0700.02316.19
5.1.30.0470.03016.19
5.1.20.0570.02716.19
5.1.10.0370.02316.19
5.1.00.0270.02316.19
5.0.50.0100.02016.19
5.0.40.0100.02716.19
5.0.30.0170.03316.19
5.0.20.0200.01316.19
5.0.10.0070.02316.19
5.0.00.0000.03716.19
4.4.90.0100.01716.19
4.4.80.0200.01716.19
4.4.70.0270.02016.19
4.4.60.0130.01316.19
4.4.50.0230.01316.19
4.4.40.0370.02016.19
4.4.30.0130.02016.19
4.4.20.0300.01716.19
4.4.10.0100.01716.19
4.4.00.0130.06316.19
4.3.110.0200.02016.19
4.3.100.0070.01716.19
4.3.90.0230.01016.19
4.3.80.0100.03316.19
4.3.70.0200.01316.19
4.3.60.0270.01316.19
4.3.50.0130.01316.19
4.3.40.0300.02316.19
4.3.30.0130.02316.19
4.3.20.0030.02016.18
4.3.10.0030.02016.19
4.3.00.0070.04715.42

preferences:
51.01 ms | 401 KiB | 5 Q