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($oAirPricingSolutionNode->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.0040.01818.56
8.3.50.0090.01322.21
8.3.40.0090.00619.21
8.3.30.0160.00318.94
8.3.20.0080.00018.98
8.3.10.0080.00021.34
8.3.00.0080.00023.95
8.2.180.0130.00916.88
8.2.170.0070.00722.96
8.2.160.0110.00320.95
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00926.16
8.2.120.0040.00421.49
8.2.110.0090.00020.70
8.2.100.0060.00617.84
8.2.90.0030.00519.61
8.2.80.0050.00219.63
8.2.70.0080.00017.75
8.2.60.0040.00418.30
8.2.50.0030.00618.07
8.2.40.0040.00418.59
8.2.30.0000.00821.50
8.2.20.0040.00417.96
8.2.10.0090.00018.16
8.2.00.0040.00418.07
8.1.280.0130.00725.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0190.00322.83
8.1.230.0000.01221.06
8.1.220.0080.00018.77
8.1.210.0050.00519.26
8.1.200.0000.01017.60
8.1.190.0000.00817.90
8.1.180.0000.00818.10
8.1.170.0080.00018.96
8.1.160.0000.00819.27
8.1.150.0000.00819.02
8.1.140.0040.00417.77
8.1.130.0080.00018.17
8.1.120.0000.00817.86
8.1.110.0030.00517.81
8.1.100.0040.00417.68
8.1.90.0040.00417.84
8.1.80.0030.00517.75
8.1.70.0030.00317.79
8.1.60.0030.00517.93
8.1.50.0080.00017.88
8.1.40.0040.00417.91
8.1.30.0080.00018.04
8.1.20.0000.00817.96
8.1.10.0030.00617.96
8.1.00.0030.00517.89
8.0.300.0030.00620.43
8.0.290.0040.00417.55
8.0.280.0040.00418.79
8.0.270.0060.00317.53
8.0.260.0030.00317.09
8.0.250.0050.00317.36
8.0.240.0000.00817.18
8.0.230.0000.00717.30
8.0.220.0050.00217.11
8.0.210.0040.00417.13
8.0.200.0030.00317.38
8.0.190.0000.00817.32
8.0.180.0030.00617.36
8.0.170.0000.00817.16
8.0.160.0030.00617.19
8.0.150.0040.00717.12
8.0.140.0000.00717.11
8.0.130.0000.00613.67
8.0.120.0040.00417.23
8.0.110.0070.00017.24
8.0.100.0070.00017.30
8.0.90.0040.00417.25
8.0.80.0060.00917.29
8.0.70.0070.00017.27
8.0.60.0040.00416.98
8.0.50.0080.00017.12
8.0.30.0130.00617.27
8.0.20.0080.01217.40
8.0.10.0050.00317.40
8.0.00.0110.00917.27
7.4.330.0000.00517.03
7.4.320.0000.00616.90
7.4.300.0000.00716.87
7.4.290.0030.00316.95
7.4.280.0030.00616.80
7.4.270.0000.00716.94
7.4.260.0060.00013.67
7.4.250.0040.00417.00
7.4.240.0080.00016.96
7.4.230.0000.00816.68
7.4.220.0130.00616.95
7.4.210.0080.00717.00
7.4.200.0060.00316.73
7.4.190.0040.00417.00
7.4.160.0070.01016.70
7.4.150.0060.01317.40
7.4.140.0100.01517.86
7.4.130.0140.00516.79
7.4.120.0080.01016.79
7.4.110.0140.00316.87
7.4.100.0120.00616.87
7.4.90.0120.00616.72
7.4.80.0150.00619.39
7.4.70.0040.01417.01
7.4.60.0120.00616.90
7.4.50.0030.00616.91
7.4.40.0090.00622.77
7.4.30.0080.01316.50
7.4.00.0040.01215.25
7.3.330.0030.00313.54
7.3.320.0030.00313.43
7.3.310.0070.00016.73
7.3.300.0000.00816.50
7.3.290.0140.00716.74
7.3.280.0050.01016.70
7.3.270.0110.00717.40
7.3.260.0120.00818.24
7.3.250.0120.00616.83
7.3.240.0150.00317.04
7.3.230.0060.01216.73
7.3.210.0110.00617.04
7.3.200.0000.01819.39
7.3.190.0120.01216.98
7.3.180.0080.00816.84
7.3.170.0120.00916.67
7.3.160.0060.01316.88
7.3.120.0110.00815.18
7.3.110.0090.00915.09
7.3.100.0100.00814.95
7.3.90.0090.00514.98
7.3.80.0030.01315.16
7.3.70.0090.00814.89
7.3.60.0080.00815.01
7.3.50.0060.00914.88
7.3.40.0070.00715.14
7.3.30.0110.00515.01
7.3.20.0050.01116.89
7.3.10.0080.00416.77
7.3.00.0070.00716.83
7.2.330.0120.00617.18
7.2.320.0160.00316.77
7.2.310.0130.00716.96
7.2.300.0080.01517.09
7.2.290.0090.00916.93
7.2.250.0090.01015.33
7.2.240.0110.00915.45
7.2.230.0080.00915.16
7.2.220.0080.00815.25
7.2.210.0110.00615.37
7.2.200.0080.00715.26
7.2.190.0110.00315.29
7.2.180.0060.01015.19
7.2.170.0020.01115.35
7.2.130.0000.01417.20
7.2.120.0070.00717.28
7.2.110.0030.01016.98
7.2.100.0130.00317.16
7.2.90.0060.00617.05
7.2.80.0030.01417.10
7.2.70.0100.00316.95
7.2.60.0070.00717.09
7.2.50.0060.00617.02
7.2.40.0030.00917.21
7.2.30.0070.00717.02
7.2.20.0000.01517.20
7.2.10.0030.00917.03
7.2.00.0060.00818.27
7.1.330.0040.01115.91
7.1.320.0060.00915.90
7.1.310.0040.01116.05
7.1.300.0080.01016.02
7.1.290.0090.00416.01
7.1.280.0060.00615.99
7.1.270.0050.01016.06
7.1.260.0040.01216.23
7.1.250.0000.00815.93
7.1.100.0040.00918.46
7.1.70.0180.00617.27
7.1.60.0000.01117.35
7.1.50.0040.00717.12
7.1.00.0030.06722.46
7.0.200.0070.00716.67
7.0.140.0000.07722.20
7.0.100.0370.07320.17
7.0.90.0370.07720.28
7.0.80.0130.08020.05
7.0.70.0300.09020.22
7.0.60.0430.07720.07
7.0.50.0400.07720.50
7.0.40.0000.07320.33
7.0.30.0100.07720.21
7.0.20.0100.08720.34
7.0.10.0030.07320.26
7.0.00.0100.08020.23
5.6.280.0030.07321.11
5.6.250.0070.05720.93
5.6.240.0070.08020.85
5.6.230.0200.06020.66
5.6.220.0100.05020.64
5.6.210.0070.05020.76
5.6.200.0100.04721.24
5.6.190.0000.09321.20
5.6.180.0000.08321.31
5.6.170.0130.08021.07
5.6.160.0170.08021.26
5.6.150.0000.08321.18
5.6.140.0030.09321.06
5.6.130.0030.08321.08
5.6.120.0070.08021.21
5.6.110.0100.08321.19
5.6.100.0170.06021.18
5.6.90.0100.04321.19
5.6.80.0100.06720.56
5.6.70.0130.06320.73
5.6.60.0100.03320.70
5.6.50.0100.08320.61
5.6.40.0130.07720.64
5.6.30.0000.08020.45
5.6.20.0070.06720.52
5.6.10.0170.06720.71
5.6.00.0030.09020.45
5.5.380.0070.05320.48
5.5.370.0200.03720.51
5.5.360.0030.07320.66
5.5.350.0000.08320.52
5.5.340.0100.07721.11
5.5.330.0070.08321.10
5.5.320.0030.07721.11
5.5.310.0000.05720.89
5.5.300.0070.08020.95
5.5.290.0130.07320.95
5.5.280.0100.08020.95
5.5.270.0070.08020.98
5.5.260.0130.04721.00
5.5.250.0100.05720.69
5.5.240.0100.03320.44
5.5.230.0030.08320.23
5.5.220.0070.07720.40
5.5.210.0070.08020.40
5.5.200.0100.06720.40
5.5.190.0000.09320.43
5.5.180.0130.07320.21
5.5.160.0130.07020.40
5.5.150.0170.06020.21
5.5.140.0170.03320.27
5.5.130.0130.07320.33
5.5.120.0100.09020.47
5.5.110.0130.07020.33
5.5.100.0030.07720.18
5.5.90.0030.07720.10
5.5.80.0130.07320.30
5.5.70.0070.06020.29
5.5.60.0070.04720.28
5.5.50.0100.07320.33
5.5.40.0070.08020.30
5.5.30.0070.07720.18
5.5.20.0100.08020.19
5.5.10.0200.06720.30
5.5.00.0170.06020.29
5.4.450.0070.08019.57
5.4.440.0030.08719.54
5.4.430.0000.11019.55
5.4.420.0070.07719.62
5.4.410.0030.08019.48
5.4.400.0100.07719.26
5.4.390.0100.07719.39
5.4.380.0070.06719.08
5.4.370.0030.08319.25
5.4.360.0130.03719.23
5.4.350.0030.07319.23
5.4.340.0000.07718.95
5.4.320.0100.07019.19
5.4.310.0130.07319.44
5.4.300.0000.08319.23
5.4.290.0100.07019.23
5.4.280.0130.07019.08
5.4.270.0070.08019.25
5.4.260.0070.08019.23
5.4.250.0070.07019.24
5.4.240.0100.07019.25
5.4.230.0070.07719.38
5.4.220.0030.08719.22
5.4.210.0070.04719.22
5.4.200.0030.08019.28
5.4.190.0070.08019.21
5.4.180.0070.04319.26
5.4.170.0000.04319.25
5.4.160.0130.04719.20
5.4.150.0030.08319.23
5.4.140.0070.08016.59
5.4.130.0070.07316.44
5.4.120.0130.06016.58
5.4.110.0100.07716.57
5.4.100.0030.04316.59
5.4.90.0000.08016.53
5.4.80.0100.06716.50
5.4.70.0070.06716.48
5.4.60.0070.06016.55
5.4.50.0070.04016.38
5.4.40.0070.06016.68
5.4.30.0070.07016.42
5.4.20.0100.06716.54
5.4.10.0130.06016.66
5.4.00.0130.05715.91
5.3.290.0030.05714.68
5.3.280.0030.07014.83
5.3.270.0070.07714.77
5.3.260.0200.06314.82
5.3.250.0100.06714.86
5.3.240.0100.07714.84
5.3.230.0070.07314.77
5.3.220.0100.06714.79
5.3.210.0130.05014.71
5.3.200.0070.07314.80
5.3.190.0130.07014.72
5.3.180.0100.07314.72
5.3.170.0100.06714.78
5.3.160.0030.04314.72
5.3.150.0070.07714.75
5.3.140.0030.04314.71
5.3.130.0100.07314.79
5.3.120.0170.06714.57
5.3.110.0030.08014.70
5.3.100.0030.07714.25
5.3.90.0070.07714.23
5.3.80.0130.06014.17
5.3.70.0130.06314.20
5.3.60.0130.06014.13
5.3.50.0030.06714.15
5.3.40.0030.08014.08
5.3.30.0100.04314.06
5.3.20.0030.07713.90
5.3.10.0070.06713.57
5.3.00.0130.06313.79
5.2.170.0130.05311.13
5.2.160.0100.05011.37
5.2.150.0100.06011.12
5.2.140.0000.07011.29
5.2.130.0100.05711.37
5.2.120.0030.06711.31
5.2.110.0030.06311.08
5.2.100.0030.06011.27
5.2.90.0030.06311.23
5.2.80.0030.03711.32
5.2.70.0070.04711.24
5.2.60.0030.06311.28
5.2.50.0130.04311.29
5.2.40.0100.04311.08
5.2.30.0030.03311.26
5.2.20.0070.05711.09
5.2.10.0000.06011.07
5.2.00.0030.04710.93
5.1.60.0070.04710.19
5.1.50.0030.05310.17
5.1.40.0030.04010.17
5.1.30.0100.05010.59
5.1.20.0030.05710.45
5.1.10.0030.04310.32
5.1.00.0070.04310.23
5.0.50.0030.0338.98
5.0.40.0070.0438.98
5.0.30.0070.0638.98
5.0.20.0000.0378.98
5.0.10.0000.0438.98
5.0.00.0000.0638.98
4.4.90.0030.0378.98
4.4.80.0030.0378.98
4.4.70.0030.0208.98
4.4.60.0000.0378.98
4.4.50.0070.0178.98
4.4.40.0070.0478.98
4.4.30.0030.0308.98
4.4.20.0070.0308.98
4.4.10.0000.0378.98
4.4.00.0030.0438.98
4.3.110.0030.0338.98
4.3.100.0100.0208.98
4.3.90.0030.0208.98
4.3.80.0030.0508.98
4.3.70.0000.0338.98
4.3.60.0000.0338.98
4.3.50.0100.0178.98
4.3.40.0000.0508.98
4.3.30.0070.0308.98
4.3.20.0000.0338.98
4.3.10.0030.0238.98
4.3.00.0000.0208.98

preferences:
47.15 ms | 401 KiB | 5 Q