3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ('backtrace', 'print'); array_walk($array, 'walk_callback', str_repeat("\0",1024)); function walk_callback($value, $key, $userdata) { if ($value == 'print') { var_dump(bin2hex($userdata)); exit("\n\n"); } elseif ($value == 'backtrace') { debug_backtrace(); if ($userdata !== str_repeat("\0",1024)) { die("won't get here, \$userdata is still clean until we return"); } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hresu
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_walk'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'walk_callback'
          4        INIT_FCALL                                               'str_repeat'
          5        SEND_VAL                                                 '%00'
          6        SEND_VAL                                                 1024
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
   21    10      > RETURN                                                   1

Function walk_callback:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 24
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/Hresu
function name:  walk_callback
number of ops:  25
compiled vars:  !0 = $value, !1 = $key, !2 = $userdata
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    8     3        IS_EQUAL                                                 !0, 'print'
          4      > JMPZ                                                     ~3, ->13
   10     5    >   INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'bin2hex'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
   11    11      > EXIT                                                     '%0A%0A'
         12*       JMP                                                      ->24
   13    13    >   IS_EQUAL                                                 !0, 'backtrace'
         14      > JMPZ                                                     ~6, ->24
   15    15    >   INIT_FCALL                                               'debug_backtrace'
         16        DO_ICALL                                                 
   16    17        INIT_FCALL                                               'str_repeat'
         18        SEND_VAL                                                 '%00'
         19        SEND_VAL                                                 1024
         20        DO_ICALL                                         $8      
         21        IS_NOT_IDENTICAL                                         !2, $8
         22      > JMPZ                                                     ~9, ->24
   18    23    > > EXIT                                                     'won%27t+get+here%2C+%24userdata+is+still+clean+until+we+return'
   21    24    > > RETURN                                                   null

End of function walk_callback

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.85 ms | 1400 KiB | 23 Q