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>'; $oAirPricingSolutionNode = new DOMDocument(); $oAirPricingSolutionNode->loadXml('<root xmlns:air="http://www.travelport.com/schema/air_v22_0"></root>'); $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($this->importNode($oAirPricingInfoNode, TRUE)); } echo $oAirPricingSolutionNode->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.01418.68
8.3.50.0130.00722.11
8.3.40.0080.00819.03
8.3.30.0060.01318.91
8.3.20.0090.00019.02
8.3.10.0080.00021.42
8.3.00.0050.00323.80
8.2.180.0030.01317.00
8.2.170.0070.00722.96
8.2.160.0080.00820.77
8.2.150.0030.00524.18
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0090.00021.16
8.2.110.0030.00720.57
8.2.100.0040.00718.22
8.2.90.0040.00419.42
8.2.80.0040.00419.66
8.2.70.0060.00317.88
8.2.60.0040.00418.18
8.2.50.0030.00518.07
8.2.40.0080.00018.34
8.2.30.0000.00721.45
8.2.20.0080.00017.96
8.2.10.0050.00318.09
8.2.00.0040.00417.98
8.1.280.0160.00425.92
8.1.270.0040.00423.99
8.1.260.0090.00926.35
8.1.250.0000.00828.09
8.1.240.0000.00922.80
8.1.230.0060.00621.29
8.1.220.0000.00818.77
8.1.210.0100.00019.09
8.1.200.0030.00617.60
8.1.190.0000.00817.90
8.1.180.0050.00318.10
8.1.170.0050.00318.96
8.1.160.0040.00419.15
8.1.150.0000.00818.87
8.1.140.0040.00417.61
8.1.130.0040.00418.06
8.1.120.0000.00717.76
8.1.110.0050.00317.78
8.1.100.0000.00717.64
8.1.90.0040.00417.76
8.1.80.0000.00717.66
8.1.70.0030.00317.66
8.1.60.0040.00417.72
8.1.50.0060.00317.65
8.1.40.0040.00417.71
8.1.30.0020.00517.80
8.1.20.0000.00817.99
8.1.10.0030.00617.92
8.1.00.0040.00417.89
8.0.300.0030.00620.05
8.0.290.0000.00817.55
8.0.280.0040.00418.71
8.0.270.0040.00417.51
8.0.260.0030.00317.10
8.0.250.0040.00417.36
8.0.240.0000.00817.25
8.0.230.0040.00417.29
8.0.220.0000.00717.20
8.0.210.0000.00717.20
8.0.200.0070.00017.30
8.0.190.0050.00217.16
8.0.180.0030.00517.11
8.0.170.0030.00617.26
8.0.160.0080.00017.22
8.0.150.0030.00417.23
8.0.140.0070.00017.26
8.0.130.0000.00513.64
8.0.120.0000.00817.24
8.0.110.0000.00717.12
8.0.100.0000.00717.16
8.0.90.0000.00717.23
8.0.80.0110.00417.11
8.0.70.0040.00417.02
8.0.60.0000.00817.14
8.0.50.0080.00017.09
8.0.30.0130.00817.35
8.0.20.0120.01017.51
8.0.10.0070.00017.37
8.0.00.0120.00816.96
7.4.330.0060.00016.96
7.4.320.0000.00616.70
7.4.300.0030.00316.83
7.4.290.0020.00516.88
7.4.280.0100.00016.71
7.4.270.0030.00316.78
7.4.260.0060.00013.54
7.4.250.0030.00616.82
7.4.240.0070.00016.88
7.4.230.0040.00416.77
7.4.220.0180.00916.58
7.4.210.0080.00716.84
7.4.200.0030.00616.89
7.4.190.0000.00716.86
7.4.160.0030.01316.72
7.4.150.0120.00617.40
7.4.140.0090.01417.86
7.4.130.0080.01016.75
7.4.120.0130.00516.86
7.4.110.0150.00316.83
7.4.100.0060.01216.93
7.4.90.0070.01116.57
7.4.80.0150.01419.39
7.4.70.0070.01016.89
7.4.60.0000.01716.75
7.4.50.0000.00816.80
7.4.40.0040.00722.77
7.4.30.0140.00716.92
7.4.10.0090.00915.04
7.4.00.0030.01415.01
7.3.330.0000.00613.54
7.3.320.0000.00613.46
7.3.310.0000.00716.73
7.3.300.0000.00716.51
7.3.290.0110.00816.67
7.3.280.0090.00816.72
7.3.270.0170.00017.40
7.3.260.0120.00918.24
7.3.250.0060.01016.63
7.3.240.0090.00916.92
7.3.230.0090.01216.87
7.3.210.0030.01616.64
7.3.200.0060.01519.39
7.3.190.0100.01116.73
7.3.180.0110.00616.68
7.3.170.0100.00716.86
7.3.160.0120.00916.73
7.3.130.0030.01615.01
7.3.120.0020.01415.13
7.3.110.0090.00815.12
7.3.100.0030.01114.98
7.3.90.0050.00815.00
7.3.80.0040.00714.91
7.3.70.0020.01115.12
7.3.60.0080.00514.91
7.3.50.0080.00515.00
7.3.40.0020.01014.79
7.3.30.0050.00714.94
7.3.20.0050.00916.93
7.3.10.0070.00316.77
7.3.00.0050.00716.91
7.2.330.0150.00316.99
7.2.320.0160.00816.97
7.2.310.0110.00916.82
7.2.300.0110.00817.04
7.2.290.0100.01316.80
7.2.260.0090.00915.17
7.2.250.0050.01215.13
7.2.240.0050.01215.18
7.2.230.0030.01115.04
7.2.220.0060.00715.14
7.2.210.0050.00515.28
7.2.200.0070.00515.21
7.2.190.0050.00915.38
7.2.180.0070.00715.41
7.2.170.0060.00615.20
7.2.160.0060.01115.16
7.2.150.0090.00617.11
7.2.140.0070.00417.04
7.2.130.0060.00617.18
7.2.120.0060.00617.13
7.2.110.0060.00617.12
7.2.100.0070.00616.92
7.2.90.0070.00617.21
7.2.80.0020.01117.07
7.2.70.0050.00617.01
7.2.60.0080.00417.10
7.2.50.0050.00717.04
7.2.40.0070.00617.16
7.2.30.0040.00917.06
7.2.20.0060.00517.24
7.2.10.0080.00417.28
7.2.00.0030.01217.96
7.1.330.0030.01016.05
7.1.320.0070.00915.99
7.1.310.0100.00216.00
7.1.300.0060.00615.94
7.1.290.0020.01016.01
7.1.280.0050.00715.73
7.1.270.0050.00716.10
7.1.260.0050.00615.90
7.1.250.0050.00716.13
7.1.240.0000.01315.95
7.1.230.0030.01315.86
7.1.220.0130.00315.92
7.1.210.0070.00715.77
7.1.200.0050.00715.93
7.1.190.0080.00316.15
7.1.180.0060.00915.82
7.1.170.0030.01315.92
7.1.160.0120.00015.85
7.1.150.0040.00816.13
7.1.140.0100.00716.11
7.1.130.0030.00716.25
7.1.120.0070.00715.80
7.1.110.0040.00716.07
7.1.100.0080.00517.09
7.1.90.0030.01416.04
7.1.80.0070.01115.92
7.1.70.0020.00816.51
7.1.60.0110.00717.55
7.1.50.0050.01216.41
7.1.40.0100.00316.02
7.1.30.0000.01616.14
7.1.20.0070.00715.96
7.1.10.0030.01315.68
7.1.00.0050.02019.29
7.0.330.0080.00415.47
7.0.320.0130.00315.59
7.0.310.0070.00315.46
7.0.300.0040.00715.30
7.0.290.0100.00315.64
7.0.280.0000.00915.64
7.0.270.0080.00415.81
7.0.260.0040.00715.64
7.0.250.0090.00915.64
7.0.240.0110.00615.76
7.0.230.0060.01215.45
7.0.220.0000.01115.68
7.0.210.0070.00715.52
7.0.200.0030.00816.33
7.0.190.0070.01015.58
7.0.180.0070.00715.47
7.0.170.0100.00715.74
7.0.160.0070.00715.68
7.0.150.0070.00715.67
7.0.140.0080.04018.81
7.0.130.0090.00715.63
7.0.120.0100.00715.69
7.0.110.0130.00015.59
7.0.100.0000.00815.60
7.0.90.0030.01015.42
7.0.80.0030.01015.62
7.0.70.0000.01215.79
7.0.60.0050.04218.82
7.0.50.0130.03316.79
7.0.40.0020.04317.16
7.0.30.0140.02816.92
7.0.20.0070.03217.15
7.0.10.0030.02816.91
7.0.00.0090.04416.99
5.6.400.0050.00514.58
5.6.390.0070.00714.59
5.6.380.0100.00314.84
5.6.370.0090.00614.46
5.6.360.0060.01014.25
5.6.350.0000.01514.26
5.6.340.0030.01414.91
5.6.330.0000.01314.24
5.6.320.0100.00614.61
5.6.310.0140.00314.53
5.6.300.0060.00614.52
5.6.290.0030.01014.64
5.6.280.0090.03817.86
5.6.270.0040.00714.60
5.6.260.0000.01014.51
5.6.250.0070.00714.90
5.6.240.0110.00314.38
5.6.230.0030.00914.45
5.6.220.0030.01214.40
5.6.210.0120.04017.55
5.6.200.0090.04016.36
5.6.190.0030.02717.51
5.6.180.0210.04117.63
5.6.170.0210.02917.61
5.6.160.0080.04617.65
5.6.150.0120.02816.44
5.6.140.0020.05416.53
5.6.130.0120.04416.37
5.6.120.0080.04717.82
5.6.110.0120.04517.75
5.6.100.0070.04717.81
5.6.90.0100.04317.98
5.6.80.0080.03817.61
5.6.70.0030.00714.36
5.6.60.0110.00614.39
5.6.50.0070.00314.19
5.6.40.0000.01614.59
5.6.30.0060.00614.43
5.6.20.0080.00414.46
5.6.10.0070.00714.47
5.6.00.0110.00314.43
5.5.380.0170.00014.71
5.5.370.0080.00514.66
5.5.360.0030.01214.26
5.5.350.0210.03517.38
5.5.340.0080.03716.29
5.5.330.0110.03817.29
5.5.320.0180.03017.40
5.5.310.0170.02817.49
5.5.300.0060.02516.36
5.5.290.0060.04916.09
5.5.280.0060.02717.77
5.5.270.0030.02717.64
5.5.260.0050.03717.63
5.5.250.0070.04917.65
5.5.240.0050.02817.34
5.5.230.0060.00614.33
5.5.220.0060.00614.19
5.5.210.0040.00814.54
5.5.200.0030.01214.34
5.5.190.0060.00314.49
5.5.180.0040.00714.56
5.5.170.0040.00714.15
5.5.160.0070.01114.30
5.5.150.0100.00614.36
5.5.140.0100.00313.98
5.5.130.0080.00414.56
5.5.120.0070.00714.25
5.5.110.0070.00714.46
5.5.100.0110.00414.57
5.5.90.0120.00014.11
5.5.80.0070.00714.39
5.5.70.0060.01214.31
5.5.60.0090.00614.33
5.5.50.0070.00714.40
5.5.40.0000.01414.47
5.5.30.0070.01114.52
5.5.20.0120.00314.23
5.5.10.0070.00714.19
5.5.00.0000.01214.09
5.4.450.1970.02015.22
5.4.440.1750.02115.57
5.4.430.1830.02415.36
5.4.420.1980.02415.29
5.4.410.2280.02315.28
5.4.400.2050.02314.98
5.4.390.2140.02415.21
5.4.380.1920.02015.04
5.4.370.2000.01815.19
5.4.360.2280.02115.10
5.4.350.1890.01515.16
5.4.340.1980.02215.35
5.4.330.0060.00611.07
5.4.320.1930.02315.03
5.4.310.1930.02315.16
5.4.300.1850.02115.14
5.4.290.1780.02015.08
5.4.280.1750.02415.29
5.4.270.1830.02315.11
5.4.260.1970.02315.09
5.4.250.1750.01815.02
5.4.240.1900.02015.08
5.4.230.1910.02215.04
5.4.220.2050.01815.14
5.4.210.1250.03015.21
5.4.200.1580.02315.10
5.4.190.0880.02415.13
5.4.180.1000.02315.10
5.4.170.2020.02215.08
5.4.160.1650.02415.24
5.4.150.1500.02715.20
5.4.140.0920.02213.78
5.4.130.0830.02113.89
5.4.120.0760.02513.78
5.4.110.1960.02013.72
5.4.100.0980.02913.76
5.4.90.1860.02013.84
5.4.80.0070.03713.75
5.4.70.1560.02113.79
5.4.60.1700.02513.78
5.4.50.1940.01813.73
5.4.40.1520.02013.90
5.4.30.1500.02013.64
5.4.20.1830.02313.86
5.4.10.1530.01813.90
5.4.00.1730.01613.59
5.3.290.1940.02112.76
5.3.280.2220.02412.67
5.3.270.1010.02712.54
5.3.260.1520.02112.77
5.3.250.0730.02712.70
5.3.240.0750.02312.60
5.3.230.0960.03012.54
5.3.220.0530.02612.50
5.3.210.1130.02812.59
5.3.200.1770.02412.59
5.3.190.1760.01812.68
5.3.180.0060.02612.65
5.3.170.0060.04012.77
5.3.160.1880.02512.60
5.3.150.2000.02612.63
5.3.140.1800.02012.64
5.3.130.1670.02012.66
5.3.120.1150.02012.57
5.3.110.1270.02412.63
5.3.100.1510.02112.47
5.3.90.1500.02212.47
5.3.80.1660.02012.27
5.3.70.1280.02212.38
5.3.60.1260.02112.37
5.3.50.1670.02212.17
5.3.40.1580.02012.31
5.3.30.0020.02012.39
5.3.20.0040.02712.08
5.3.10.0620.03012.01
5.3.00.1830.02312.07
5.2.170.2470.03311.25
5.2.160.2530.03011.36
5.2.150.0700.02311.16
5.2.140.0000.03011.18
5.2.130.2300.04011.14
5.2.120.3430.03711.32
5.2.110.2770.02711.10
5.2.100.3230.02711.27
5.2.90.3130.03311.14
5.2.80.3170.02711.30
5.2.70.3300.03311.27
5.2.60.3570.03011.04
5.2.50.3870.02711.14
5.2.40.3330.02711.03
5.2.30.2900.03311.10
5.2.20.3130.03011.11
5.2.10.2830.02710.85
5.2.00.3130.03311.01
5.1.60.2700.0209.97
5.1.50.3930.03010.21
5.1.40.2870.02710.01
5.1.30.2970.03310.61
5.1.20.2700.02710.51
5.1.10.1630.02710.24
5.1.00.2400.02310.26
5.0.50.1270.0178.74
5.0.40.1470.0178.59
5.0.30.1430.0308.40
5.0.20.1430.0238.29
5.0.10.1200.0178.35
5.0.00.1500.0378.31
4.4.90.1370.0176.43
4.4.80.1570.0176.43
4.4.70.1700.0176.43
4.4.60.1670.0176.43
4.4.50.1770.0176.43
4.4.40.1600.0376.43
4.4.30.1630.0176.43
4.4.20.1330.0176.43
4.4.10.1370.0106.43
4.4.00.1470.0236.43
4.3.110.1430.0206.43
4.3.100.1300.0176.43
4.3.90.1800.0136.43
4.3.80.1500.0276.43
4.3.70.1700.0106.43
4.3.60.1370.0176.43
4.3.50.1470.0206.43
4.3.40.1300.0576.43
4.3.30.0500.0306.43
4.3.20.0770.0236.43
4.3.10.0800.0276.43
4.3.00.0800.0176.43

preferences:
43.29 ms | 401 KiB | 5 Q