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); preg_match_all('/[^(\x20-\x7F)]*/', $xmlString, $badchars); if(isset($badchars[0])) { $badchars[0] = array_unique($badchars[0]); foreach($badchars[0] as $badchar) { $xmlString = preg_replace("/".$badchar."/", utf8_encode($badchar), $xmlString); } } /* 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 = 18, Position 2 = 40
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 39
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 39
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 68
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 78
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 78
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 68
Branch analysis from position: 39
Branch analysis from position: 40
filename:       /in/RrA0K
function name:  (null)
number of ops:  83
compiled vars:  !0 = $dati2, !1 = $response, !2 = $xmlString, !3 = $badchars, !4 = $badchar, !5 = $xml, !6 = $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                                         $8      
          4        ASSIGN                                                   !1, $8
   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                                         $10     
         10        ASSIGN                                                   !2, $10
   18    11        INIT_FCALL                                               'preg_match_all'
         12        SEND_VAL                                                 '%2F%5B%5E%28%5Cx20-%5Cx7F%29%5D%2A%2F'
         13        SEND_VAR                                                 !2
         14        SEND_REF                                                 !3
         15        DO_ICALL                                                 
   19    16        ISSET_ISEMPTY_DIM_OBJ                         0          !3, 0
         17      > JMPZ                                                     ~13, ->40
   21    18    >   INIT_FCALL                                               'array_unique'
         19        FETCH_DIM_R                                      ~15     !3, 0
         20        SEND_VAL                                                 ~15
         21        DO_ICALL                                         $16     
         22        ASSIGN_DIM                                               !3, 0
         23        OP_DATA                                                  $16
   22    24        FETCH_DIM_R                                      ~17     !3, 0
         25      > FE_RESET_R                                       $18     ~17, ->39
         26    > > FE_FETCH_R                                               $18, !4, ->39
   24    27    >   INIT_FCALL                                               'preg_replace'
         28        CONCAT                                           ~19     '%2F', !4
         29        CONCAT                                           ~20     ~19, '%2F'
         30        SEND_VAL                                                 ~20
         31        INIT_FCALL                                               'utf8_encode'
         32        SEND_VAR                                                 !4
         33        DO_ICALL                                         $21     
         34        SEND_VAR                                                 $21
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                         $22     
         37        ASSIGN                                                   !2, $22
   22    38      > JMP                                                      ->26
         39    >   FE_FREE                                                  $18
   32    40    >   INIT_FCALL                                               'trim'
         41        INIT_FCALL                                               'preg_replace'
         42        SEND_VAL                                                 '%2F%3C%5C%3Fxml.%2A%5C%3F%3E%2F'
         43        SEND_VAL                                                 ''
         44        SEND_VAR                                                 !2
         45        SEND_VAL                                                 1
         46        DO_ICALL                                         $24     
         47        SEND_VAR                                                 $24
         48        DO_ICALL                                         $25     
         49        ASSIGN                                                   !2, $25
   33    50        INIT_FCALL                                               'simplexml_load_string'
         51        SEND_VAR                                                 !2
         52        SEND_VAL                                                 'SimpleXMLElement'
         53        SEND_VAL                                                 16384
         54        DO_ICALL                                         $27     
         55        ASSIGN                                                   !5, $27
   38    56        FETCH_OBJ_R                                      ~29     !5, 'soapenvBody'
         57        FETCH_OBJ_R                                      ~30     ~29, 'sendMessageResponse'
         58        FETCH_OBJ_R                                      ~31     ~30, 'sendMessageReturn'
         59        IS_NOT_EQUAL                                             ~31, null
         60      > JMPZ                                                     ~32, ->68
   39    61    >   INIT_FCALL                                               'simplexml_load_string'
         62        FETCH_OBJ_R                                      ~33     !5, 'soapenvBody'
         63        FETCH_OBJ_R                                      ~34     ~33, 'sendMessageResponse'
         64        FETCH_OBJ_R                                      ~35     ~34, 'sendMessageReturn'
         65        SEND_VAL                                                 ~35
         66        DO_ICALL                                         $36     
         67        ASSIGN                                                   !5, $36
   43    68    >   INIT_FCALL                                               'strtolower'
         69        FETCH_OBJ_R                                      ~38     !5, 'isStatusOK'
         70        SEND_VAL                                                 ~38
         71        DO_ICALL                                         $39     
         72        IS_EQUAL                                                 $39, 'true'
         73      > JMPZ                                                     ~40, ->78
   44    74    >   FETCH_OBJ_R                                      ~41     !5, 'payLoad'
         75        FETCH_OBJ_R                                      ~42     ~41, 'ADR_A19'
         76        ASSIGN                                                   !6, ~42
         77      > JMP                                                      ->79
   46    78    >   ECHO                                                     'errore'
   48    79    >   INIT_FCALL                                               'print_r'
         80        SEND_VAR                                                 !6
         81        DO_ICALL                                                 
         82      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.31 ms | 1404 KiB | 31 Q