3v4l.org

run code in 300+ PHP versions simultaneously
<?PHP function escape($string) { if(is_array($string)) { foreach($string as $key => $val) { unset($string[$key]); $string[escape($key)] = escape($val); } } else { $string = @mysql_real_escape_string($string); } return $string;}function html($string) { if(is_array($string)) { foreach($string as $key => $val) { unset($string[$key]); $string[html($key)] = html($val); } } else { $string = htmlentities($string); } return $string;}$s= escape('asd"asiqwe\\');echo $s;echo html($s);?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1bp5s
function name:  (null)
number of ops:  10
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   INIT_FCALL                                               'escape'
          1        SEND_VAL                                                 'asd%22asiqwe%5C'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
          4        ECHO                                                     !0
          5        INIT_FCALL                                               'html'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $3      
          8        ECHO                                                     $3
          9      > RETURN                                                   1

Function escape:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1bp5s
function name:  escape
number of ops:  26
compiled vars:  !0 = $string, !1 = $val, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~3, ->18
          3    > > FE_RESET_R                                       $4      !0, ->16
          4    > > FE_FETCH_R                                       ~5      $4, !1, ->16
          5    >   ASSIGN                                                   !2, ~5
          6        UNSET_DIM                                                !0, !2
          7        INIT_FCALL_BY_NAME                                       'escape'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $7      
         10        INIT_FCALL_BY_NAME                                       'escape'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0  $9      
         13        ASSIGN_DIM                                               !0, $7
         14        OP_DATA                                                  $9
         15      > JMP                                                      ->4
         16    >   FE_FREE                                                  $4
         17      > JMP                                                      ->24
         18    >   BEGIN_SILENCE                                    ~10     
         19        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         20        SEND_VAR_EX                                              !0
         21        DO_FCALL                                      0  $11     
         22        END_SILENCE                                              ~10
         23        ASSIGN                                                   !0, $11
         24    > > RETURN                                                   !0
         25*     > RETURN                                                   null

End of function escape

Function html:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1bp5s
function name:  html
number of ops:  24
compiled vars:  !0 = $string, !1 = $val, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~3, ->18
          3    > > FE_RESET_R                                       $4      !0, ->16
          4    > > FE_FETCH_R                                       ~5      $4, !1, ->16
          5    >   ASSIGN                                                   !2, ~5
          6        UNSET_DIM                                                !0, !2
          7        INIT_FCALL_BY_NAME                                       'html'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $7      
         10        INIT_FCALL_BY_NAME                                       'html'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0  $9      
         13        ASSIGN_DIM                                               !0, $7
         14        OP_DATA                                                  $9
         15      > JMP                                                      ->4
         16    >   FE_FREE                                                  $4
         17      > JMP                                                      ->22
         18    >   INIT_FCALL                                               'htmlentities'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $10     
         21        ASSIGN                                                   !0, $10
         22    > > RETURN                                                   !0
         23*     > RETURN                                                   null

End of function html

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.16 ms | 1403 KiB | 17 Q