3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array ('backtrace', 'print'); array_walk($array, 'walk_callback', str_repeat("\0",4096)); function walk_callback($value, $key, $userdata) { if ($value == 'print') { print($userdata); exit("\n\n"); } elseif ($value == 'backtrace') { debug_backtrace(); if ($userdata !== str_repeat("\0",4096)) { die("won't get here, \$userdata is still clean until we return"); } } }
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/vE2lU
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   ASSIGN                                                   !0, <array>
   3     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                                                 4096
         7        DO_ICALL                                         $2      
         8        SEND_VAR                                                 $2
         9        DO_ICALL                                                 
   5    10        NOP                                                      
  20    11      > RETURN                                                   1

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

End of function walk_callback

Generated using Vulcan Logic Dumper, using php 7.2.0