3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = " <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' TimeStamp='2016-12-01T07:14:56' EchoToken='f3edc6ef-8734-4c83-8675-c9462d808e62' Version='1.003' xsi:schemaLocation='http://www.opentravel.org/OTA/2003/05 OTA_HotelResNotifRQ.xsd'> <Errors> <Error Type='1'>Premature end of file.</Error> </Errors> </OTA_HotelResNotifRS> </SOAP-ENV:Body> </SOAP-ENV:Envelope>"; function parseReservationResponseXML($content) { /* * RateTiger response da xsi eklenince hata aldigimizdan dolayi bu bolum siliniyor. */ $content = str_replace("xsi:schemaLocation='http://www.opentravel.org/OTA/2003/05 OTA_HotelResNotifRQ.xsd'", '', $content); $requestParams = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2$3", $content); $xml = new SimpleXMLElement($requestParams); $body = $xml->xpath('//SOAP-ENV:Body')[0]; return json_decode(json_encode((array)$body), true); } var_dump(parseReservationResponseXML($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s83fY
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%0A%3CSOAP-ENV%3AEnvelope+xmlns%3ASOAP-ENV%3D%27http%3A%2F%2Fschemas.xmlsoap.org%2Fsoap%2Fenvelope%2F%27%3E%0A++++%3CSOAP-ENV%3ABody%3E%0A++++++++%3COTA_HotelResNotifRS+xmlns%3D%27http%3A%2F%2Fwww.opentravel.org%2FOTA%2F2003%2F05%27+TimeStamp%3D%272016-12-01T07%3A14%3A56%27+EchoToken%3D%27f3edc6ef-8734-4c83-8675-c9462d808e62%27+Version%3D%271.003%27+xsi%3AschemaLocation%3D%27http%3A%2F%2Fwww.opentravel.org%2FOTA%2F2003%2F05+OTA_HotelResNotifRQ.xsd%27%3E%0A++++++++++++%3CErrors%3E%0A++++++++++++++++%3CError+Type%3D%271%27%3EPremature+end+of+file.%3C%2FError%3E%0A++++++++++++%3C%2FErrors%3E%0A++++++++%3C%2FOTA_HotelResNotifRS%3E%0A++++%3C%2FSOAP-ENV%3ABody%3E%0A%3C%2FSOAP-ENV%3AEnvelope%3E'
   28     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'parsereservationresponsexml'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function parsereservationresponsexml:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s83fY
function name:  parseReservationResponseXML
number of ops:  32
compiled vars:  !0 = $content, !1 = $requestParams, !2 = $xml, !3 = $body
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 'xsi%3AschemaLocation%3D%27http%3A%2F%2Fwww.opentravel.org%2FOTA%2F2003%2F05+OTA_HotelResNotifRQ.xsd%27'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !0, $4
   21     7        INIT_FCALL                                               'preg_replace'
          8        SEND_VAL                                                 '%2F%28%3C%5C%2F%3F%29%28%5Cw%2B%29%3A%28%5B%5E%3E%5D%2A%3E%29%2F'
          9        SEND_VAL                                                 '%241%242%243'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !1, $6
   22    13        NEW                                              $8      'SimpleXMLElement'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !2, $8
   23    17        INIT_METHOD_CALL                                         !2, 'xpath'
         18        SEND_VAL_EX                                              '%2F%2FSOAP-ENV%3ABody'
         19        DO_FCALL                                      0  $11     
         20        FETCH_DIM_R                                      ~12     $11, 0
         21        ASSIGN                                                   !3, ~12
   25    22        INIT_FCALL                                               'json_decode'
         23        INIT_FCALL                                               'json_encode'
         24        CAST                                          7  ~14     !3
         25        SEND_VAL                                                 ~14
         26        DO_ICALL                                         $15     
         27        SEND_VAR                                                 $15
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $16     
         30      > RETURN                                                   $16
   26    31*     > RETURN                                                   null

End of function parsereservationresponsexml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.96 ms | 1403 KiB | 24 Q