3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dati2 = "<PDresponse> <isStatusOK>true</isStatusOK> <status>0</status> <payLoad> </payLoad> </PDresponse>"; $response = html_entity_decode($dati2); $xmlString = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2$3", $response); /* adesso posso usare simplexml */ $xmlString = trim(preg_replace('/<\?xml.*\?>/', '', $xmlString, 1)); $xml = simplexml_load_string($xmlString,'SimpleXMLElement', LIBXML_NOCDATA); //print_r($xml); /* Verifico che il messaggio non sia ancora sporco, si sa mai*/ if($xml->soapenvBody->sendMessageResponse->sendMessageReturn != NULL) $xml = simplexml_load_string($xml->soapenvBody->sendMessageResponse->sendMessageReturn); //print_r($xml); if(strtolower($xml->isStatusOK) == "true") $hl7mess = $xml->payLoad->{'ADR_A19'}; else echo "errore"; print_r($hl7mess);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 39
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 49
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/5ikKv
function name:  (null)
number of ops:  54
compiled vars:  !0 = $dati2, !1 = $response, !2 = $xmlString, !3 = $xml, !4 = $hl7mess
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3CPDresponse%3E%0A%3CisStatusOK%3Etrue%3C%2FisStatusOK%3E%0A%3Cstatus%3E0%3C%2Fstatus%3E%0A%3CpayLoad%3E%0A%3C%2FpayLoad%3E%0A%3C%2FPDresponse%3E'
   10     1        INIT_FCALL                                               'html_entity_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
   15     5        INIT_FCALL                                               'preg_replace'
          6        SEND_VAL                                                 '%2F%28%3C%5C%2F%3F%29%28%5Cw%2B%29%3A%28%5B%5E%3E%5D%2A%3E%29%2F'
          7        SEND_VAL                                                 '%241%242%243'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
   23    11        INIT_FCALL                                               'trim'
         12        INIT_FCALL                                               'preg_replace'
         13        SEND_VAL                                                 '%2F%3C%5C%3Fxml.%2A%5C%3F%3E%2F'
         14        SEND_VAL                                                 ''
         15        SEND_VAR                                                 !2
         16        SEND_VAL                                                 1
         17        DO_ICALL                                         $10     
         18        SEND_VAR                                                 $10
         19        DO_ICALL                                         $11     
         20        ASSIGN                                                   !2, $11
   24    21        INIT_FCALL                                               'simplexml_load_string'
         22        SEND_VAR                                                 !2
         23        SEND_VAL                                                 'SimpleXMLElement'
         24        SEND_VAL                                                 16384
         25        DO_ICALL                                         $13     
         26        ASSIGN                                                   !3, $13
   29    27        FETCH_OBJ_R                                      ~15     !3, 'soapenvBody'
         28        FETCH_OBJ_R                                      ~16     ~15, 'sendMessageResponse'
         29        FETCH_OBJ_R                                      ~17     ~16, 'sendMessageReturn'
         30        IS_NOT_EQUAL                                             ~17, null
         31      > JMPZ                                                     ~18, ->39
   30    32    >   INIT_FCALL                                               'simplexml_load_string'
         33        FETCH_OBJ_R                                      ~19     !3, 'soapenvBody'
         34        FETCH_OBJ_R                                      ~20     ~19, 'sendMessageResponse'
         35        FETCH_OBJ_R                                      ~21     ~20, 'sendMessageReturn'
         36        SEND_VAL                                                 ~21
         37        DO_ICALL                                         $22     
         38        ASSIGN                                                   !3, $22
   34    39    >   INIT_FCALL                                               'strtolower'
         40        FETCH_OBJ_R                                      ~24     !3, 'isStatusOK'
         41        SEND_VAL                                                 ~24
         42        DO_ICALL                                         $25     
         43        IS_EQUAL                                                 $25, 'true'
         44      > JMPZ                                                     ~26, ->49
   35    45    >   FETCH_OBJ_R                                      ~27     !3, 'payLoad'
         46        FETCH_OBJ_R                                      ~28     ~27, 'ADR_A19'
         47        ASSIGN                                                   !4, ~28
         48      > JMP                                                      ->50
   37    49    >   ECHO                                                     'errore'
   39    50    >   INIT_FCALL                                               'print_r'
         51        SEND_VAR                                                 !4
         52        DO_ICALL                                                 
         53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.35 ms | 1392 KiB | 25 Q