3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0"?> <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP:Body> <air:AirCreateReservationRsp xmlns:air="http://www.travelport.com/schema/air_v22_0" xmlns:common_v19_0="http://www.travelport.com/schema/common_v19_0" TransactionId="2B80DFAF0A0758B057F0CDE7FBD86EA9" ResponseTime="3018"> <common_v19_0:ResponseMessage Code="0" Type="Warning" ProviderCode="1P"><![CDATA[* NON ENDO//FARE RSTR COULD APPLY * PRICING RULES VALIDATING CARRIER DEFAULT KL]]></common_v19_0:ResponseMessage> <common_v19_0:ResponseMessage Code="0" Type="Warning" ProviderCode="1P"><![CDATA[* FARE MAY CHANGE UNLESS TICKETED *]]></common_v19_0:ResponseMessage> <universal:UniversalRecord xmlns:universal="http://www.travelport.com/schema/universal_v20_0" xmlns:common_v19_0="http://www.travelport.com/schema/common_v19_0" LocatorCode="3M5N8M" Version="0" Status="Active"> <common_v19_0:BookingTraveler Key="16546489" TravelerType="ADT" DOB="1993-03-23" Gender="M"> <common_v19_0:BookingTravelerName Prefix="MR." First="Edo" Last="Rivai"/> <common_v19_0:PhoneNumber Key="21390125" Number="0208943309" Text="PaperFlies"> <common_v19_0:ProviderReservationInfoRef Key="10277507"/> </common_v19_0:PhoneNumber> <common_v19_0:SSR Key="25037887" Status="HK" Type="DOCS" FreeText="1/////@-----@/M//EDO/RIVAI" Carrier="KL" ProviderReservationInfoRef="10277507"/> <common_v19_0:SSR Key="25037888" Status="HK" Type="PSPT" FreeText="1@@----------" Carrier="YY" ProviderReservationInfoRef="10277507"/> <common_v19_0:SSR Key="25037889" Status="HK" Type="DOCS" FreeText="1/////@-----@/M//EDO/RIVAI" Carrier="YY" ProviderReservationInfoRef="10277507"/> <common_v19_0:NameRemark Key="1871595"> <common_v19_0:RemarkData>23MAR93</common_v19_0:RemarkData> <common_v19_0:ProviderReservationInfoRef Key="10277507"/> </common_v19_0:NameRemark> </common_v19_0:BookingTraveler> <common_v19_0:ActionStatus Key="9738722" Type="ACTIVE" ProviderReservationInfoRef="10277507" ProviderCode="1P"/> <universal:ProviderReservationInfo Key="10277507" ProviderCode="1P" LocatorCode="3EWQ5L" CreateDate="2014-02-13T13:47:52.932+00:00" ModifiedDate="2014-02-13T13:47:52.932+00:00" HostCreateDate="2014-02-13"/> <air:AirReservation xmlns:air="http://www.travelport.com/schema/air_v22_0" xmlns:common_v19_0="http://www.travelport.com/schema/common_v19_0" LocatorCode="EJQFA6" CreateDate="2014-02-13T13:47:51.004+00:00" ModifiedDate="2014-02-13T13:47:52.932+00:00"> <common_v19_0:BookingTravelerRef Key="16546489"/> <common_v19_0:ProviderReservationInfoRef Key="10277507"/> <air:AirSegment Key="37512747" Group="0" Carrier="KL" CabinClass="Economy" FlightNumber="835" ProviderCode="1P" Origin="AMS" Destination="DPS" DepartureTime="2014-03-01T21:00:00.000+01:00" ArrivalTime="2014-03-02T20:15:00.000+08:00" TravelTime="975" Distance="7560" ClassOfService="Q" ETicketability="Yes" Status="HK" ChangeOfPlane="false" ProviderReservationInfoRef="10277507" TravelOrder="1" OptionalServicesIndicator="false"> <air:FlightDetails Key="41770577" Origin="AMS" Destination="SIN" DepartureTime="2014-03-01T21:00:00.000+01:00" ArrivalTime="2014-03-02T16:20:00.000+08:00" FlightTime="1220" TravelTime="1220" Distance="6532" Equipment="772"/> <air:FlightDetails Key="41770578" Origin="SIN" Destination="DPS" DepartureTime="2014-03-02T17:35:00.000+08:00" ArrivalTime="2014-03-02T20:15:00.000+08:00" FlightTime="240" TravelTime="1615" Distance="1040" Equipment="772"/> </air:AirSegment> <air:AirSegment Key="37512748" Group="1" Carrier="KL" CabinClass="Economy" FlightNumber="836" ProviderCode="1P" Origin="DPS" Destination="AMS" DepartureTime="2014-04-01T20:35:00.000+08:00" ArrivalTime="2014-04-02T07:15:00.000+02:00" TravelTime="1000" Distance="7560" ClassOfService="N" ETicketability="Yes" Status="HK" ChangeOfPlane="false" ProviderReservationInfoRef="10277507" TravelOrder="2" OptionalServicesIndicator="false"> <air:FlightDetails Key="41770579" Origin="DPS" Destination="SIN" DepartureTime="2014-04-01T20:35:00.000+08:00" ArrivalTime="2014-04-01T23:05:00.000+08:00" FlightTime="230" TravelTime="230" Distance="1040" Equipment="77W"/> <air:FlightDetails Key="41770580" Origin="SIN" Destination="AMS" DepartureTime="2014-04-02T00:30:00.000+08:00" ArrivalTime="2014-04-02T07:15:00.000+02:00" FlightTime="1245" TravelTime="1640" Distance="6532" Equipment="77W"/> </air:AirSegment> <air:AirPricingInfo Key="13444787" TotalPrice="EUR878.05" BasePrice="EUR520.00" ApproximateTotalPrice="EUR878.05" ApproximateBasePrice="EUR520.00" Taxes="EUR358.05" LatestTicketingTime="2014-02-16T23:59:00.000+01:00" PricingMethod="Auto" ProviderCode="1P" ProviderReservationInfoRef="10277507" AirPricingInfoGroup="1" PricingType="TicketRecord"> <air:FareInfo Key="41624773" FareBasis="QSFNL" PassengerTypeCode="ADT" Origin="AMS" Destination="DPS" EffectiveDate="2014-02-13T14:47:52.929+01:00" TravelDate="2014-03-01" DepartureDate="2014-03-01" Amount="NUC409.91"> <air:BaggageAllowance> <air:NumberOfPieces>1</air:NumberOfPieces> <air:MaxWeight/> </air:BaggageAllowance> </air:FareInfo> <air:FareInfo Key="41624774" FareBasis="NRDNL" PassengerTypeCode="ADT" Origin="DPS" Destination="AMS" EffectiveDate="2014-02-13T21:47:52.930+08:00" TravelDate="2014-04-01" DepartureDate="2014-03-01" Amount="NUC300.60"> <air:BaggageAllowance> <air:NumberOfPieces>1</air:NumberOfPieces> <air:MaxWeight/> </air:BaggageAllowance> </air:FareInfo> <air:BookingInfo BookingCode="Q" FareInfoRef="41624773" SegmentRef="37512747"/> <air:BookingInfo BookingCode="N" FareInfoRef="41624774" SegmentRef="37512748"/> <air:TaxInfo Category="RN" Amount="EUR15.40" Key="83350600"/> <air:TaxInfo Category="VV" Amount="EUR2.00" Key="83350601"/> <air:TaxInfo Category="CJ" Amount="EUR12.77" Key="83350602"/> <air:TaxInfo Category="OO" Amount="EUR3.48" Key="83350603"/> <air:TaxInfo Category="SG" Amount="EUR10.40" Key="83350604"/> <air:TaxInfo Category="YR" Amount="EUR314.00" Key="83350605"/> <air:FareCalc>ADT AMS KL DPS409.91KL AMS300.60NUC710.51END ROE.731857 KL XT12.77CJ3.48OO10.40SG314.00YR</air:FareCalc> <air:PassengerType Code="ADT" BookingTravelerRef="16546489"/> <common_v19_0:BookingTravelerRef Key="16546489"/> <air:AirPricingModifiers FaresIndicator="PublicAndPrivateFares"/> </air:AirPricingInfo> </air:AirReservation> <common_v19_0:GeneralRemark Key="94946982" TypeInGds="Basic" SupplierType="Air" ProviderReservationInfoRef="10277507"> <common_v19_0:RemarkData>TARIEFSOORT PUBLISHED ALL</common_v19_0:RemarkData> </common_v19_0:GeneralRemark> <common_v19_0:AgencyInfo> <common_v19_0:AgentAction ActionType="Created" AgentCode="UAPI3320847692-B40600CD" BranchCode="P1639688" AgencyCode="S1639678" EventTime="2014-02-13T13:47:50.116+00:00"/> </common_v19_0:AgencyInfo> </universal:UniversalRecord> <common_v19_0:RequestKeyMappings> <common_v19_0:KeyMapping ElementName="AirSegment" OriginalKey="2T" NewKey="37512747"/> <common_v19_0:KeyMapping ElementName="AirSegment" OriginalKey="3T" NewKey="37512748"/> <common_v19_0:KeyMapping ElementName="BookingTraveler" OriginalKey="1" NewKey="16546489"/> </common_v19_0:RequestKeyMappings> </air:AirCreateReservationRsp> </SOAP:Body> </SOAP:Envelope>'; $doc = new DomDocument(); $doc->loadXML($xml); $confirmationStatusCodes = ["MK"]; $segments = $doc->getElementsByTagName('AirReservation')->item(0); foreach($segments->childNodes as $segment) { if ("air:AirSegment" == $segment->nodeName) { if (FALSE == in_array($segment->getAttribute("Status"), $confirmationStatusCodes)) { echo TRUE; } } echo FALSE; } ?>
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
11
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/5C46O on line 80
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/5C46O on line 80
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/5C46O on line 80
Process exited with code 255.

preferences:
241.84 ms | 401 KiB | 456 Q