3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = ' <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <OTA_HotelResNotifRS xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.opentravel.org/OTA/2003/05 OTA_HotelResNotifRQ.xsd" TimeStamp="2017-04-25T13:54:59+02:00" Version="1.003" EchoToken="58ff3910062c0"> <Success /> <HotelReservations> <HotelReservation> <UniqueID Type="14" ID="24671-CH108B541" /> <ResGlobalInfo> <HotelReservationIDs> <HotelReservationID ResID_Type="14" ResID_Value="24671-CH108B541" /> </HotelReservationIDs> </ResGlobalInfo> </HotelReservation> </HotelReservations> </OTA_HotelResNotifRS> </SOAP-ENV:Body> </SOAP-ENV:Envelope> '; function getProviderReferenceCode($response) { $response = $this->getOtaReservationService()->parseReservationResponseXML($response); if (!empty($response['OTA_HotelResNotifRS']) && !array_key_exists('Success', $response['OTA_HotelResNotifRS'])) { return false; } $providerReferenceCode = (isset($response['OTA_HotelResNotifRS']['HotelReservations']['HotelReservation']['ResGlobalInfo']['HotelReservationIDs']['HotelReservationID']['@attributes']['ResID_Value'])) ? $response['OTA_HotelResNotifRS']['HotelReservations']['HotelReservation']['ResGlobalInfo']['HotelReservationIDs']['HotelReservationID']['@attributes']['ResID_Value'] : false; if (!$providerReferenceCode) { return false; } return $providerReferenceCode; } var_dump(getProviderReferenceCode($xml));
Output for 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.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Using $this when not in object context in /in/bcevh:25 Stack trace: #0 /in/bcevh(42): getProviderReferenceCode('\n<SOAP-ENV:Enve...') #1 {main} thrown in /in/bcevh on line 25
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught Error: Using $this when not in object context in /in/bcevh:25 Stack trace: #0 /in/bcevh(42): getProviderReferenceCode('\n<SOAP-ENV:Enve...') #1 {main} thrown in /in/bcevh on line 25
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Fatal error: Using $this when not in object context in /in/bcevh on line 25
Process exited with code 255.

preferences:
219.52 ms | 401 KiB | 291 Q