3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decode($data, $encoding) { // convert string if (is_string($data)) { if (function_exists('iconv')) { // iconv is by far the most flexible approach, try this first $return_value = iconv('UTF-8', $encoding, $data); } elseif ($encoding == 'ISO-8859-1') { // for ISO-8859-1 we can use utf8-decode() $return_value = utf8_decode($data); } else { // give up. if data was supplied in the correct format everything is fine! $return_value = $data; } // end: if } else { // non-string value $return_value = $data; } // end: if return $return_value; } $response = "0;78d13qqoglyszmorspfwfdmwffgnubgr;\u003c?dpf sent len=\"1\"?\u003eText~~~\u003c?dpf /sent ?\u003e"; $response = str_replace("\u003c", "<", $response); echo $response;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Erldv
function name:  (null)
number of ops:  9
compiled vars:  !0 = $response
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   ASSIGN                                                   !0, '0%3B78d13qqoglyszmorspfwfdmwffgnubgr%3B%5Cu003c%3Fdpf+sent+len%3D%221%22%3F%5Cu003eText%7E%7E%7E%5Cu003c%3Fdpf+%2Fsent+%3F%5Cu003e'
   23     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '%5Cu003c'
          3        SEND_VAL                                                 '%3C'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
   24     7        ECHO                                                     !0
          8      > RETURN                                                   1

Function decode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Erldv
function name:  decode
number of ops:  27
compiled vars:  !0 = $data, !1 = $encoding, !2 = $return_value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        TYPE_CHECK                                   64          !0
          3      > JMPZ                                                     ~3, ->24
    5     4    >   INIT_FCALL                                               'function_exists'
          5        SEND_VAL                                                 'iconv'
          6        DO_ICALL                                         $4      
          7      > JMPZ                                                     $4, ->15
    7     8    >   INIT_FCALL_BY_NAME                                       'iconv'
          9        SEND_VAL_EX                                              'UTF-8'
         10        SEND_VAR_EX                                              !1
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0  $5      
         13        ASSIGN                                                   !2, $5
         14      > JMP                                                      ->23
    8    15    >   IS_EQUAL                                                 !1, 'ISO-8859-1'
         16      > JMPZ                                                     ~7, ->22
   10    17    >   INIT_FCALL                                               'utf8_decode'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $8      
         20        ASSIGN                                                   !2, $8
         21      > JMP                                                      ->23
   13    22    >   ASSIGN                                                   !2, !0
         23    > > JMP                                                      ->25
   18    24    >   ASSIGN                                                   !2, !0
   20    25    > > RETURN                                                   !2
   21    26*     > RETURN                                                   null

End of function decode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.5 ms | 1400 KiB | 19 Q