3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1, 2, 3, 4, 5 ); $step = 2; function myfunc($key, $value) { global $step; if ($key == $step) echo ' $ '; echo "$value "; } array_walk($a, 'myfunc');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Abac1
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a, !1 = $step
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 2
   11     2        INIT_FCALL                                               'array_walk'
          3        SEND_REF                                                 !0
          4        SEND_VAL                                                 'myfunc'
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function myfunc:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/Abac1
function name:  myfunc
number of ops:  10
compiled vars:  !0 = $key, !1 = $value, !2 = $step
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        BIND_GLOBAL                                              !2, 'step'
    8     3        IS_EQUAL                                                 !0, !2
          4      > JMPZ                                                     ~3, ->6
          5    >   ECHO                                                     '+%24+'
    9     6    >   NOP                                                      
          7        FAST_CONCAT                                      ~4      !1, '+'
          8        ECHO                                                     ~4
   10     9      > RETURN                                                   null

End of function myfunc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.95 ms | 1395 KiB | 15 Q