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 = htmlentities($string); } return $string; } $x = ["asd" => "as'd"]; print_r(escape($x));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wed1Z
function name:  (null)
number of ops:  8
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'escape'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > 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 = 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/Wed1Z
function name:  escape
number of ops:  24
compiled vars:  !0 = $string, !1 = $val, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~3, ->18
    5     3    > > FE_RESET_R                                       $4      !0, ->16
          4    > > FE_FETCH_R                                       ~5      $4, !1, ->16
          5    >   ASSIGN                                                   !2, ~5
    6     6        UNSET_DIM                                                !0, !2
    7     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
    5    15      > JMP                                                      ->4
         16    >   FE_FREE                                                  $4
         17      > JMP                                                      ->22
   10    18    >   INIT_FCALL                                               'htmlentities'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $10     
         21        ASSIGN                                                   !0, $10
   12    22    > > RETURN                                                   !0
   13    23*     > RETURN                                                   null

End of function escape

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.59 ms | 1390 KiB | 18 Q