3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $att = 0; public function __construct(){} public function do() { $this->att = 42; $array = ['test1', 'test2', 'test3', 'test4']; array_walk($array, [$this, 'go']); } public function go($value, $key) { echo $value,'<br>'; echo $this->att,'<br>'; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8s4YQ
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E > > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8s4YQ
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   null

End of function __construct

Function do:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8s4YQ
function name:  do
number of ops:  11
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN_OBJ                                               'att'
          1        OP_DATA                                                  42
   12     2        ASSIGN                                                   !0, <array>
   14     3        INIT_FCALL                                               'array_walk'
          4        SEND_REF                                                 !0
          5        FETCH_THIS                                       ~3      
          6        INIT_ARRAY                                       ~4      ~3
          7        ADD_ARRAY_ELEMENT                                ~4      'go'
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
   15    10      > RETURN                                                   null

End of function do

Function go:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8s4YQ
function name:  go
number of ops:  8
compiled vars:  !0 = $value, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        ECHO                                                     !0
          3        ECHO                                                     '%3Cbr%3E'
   20     4        FETCH_OBJ_R                                      ~2      'att'
          5        ECHO                                                     ~2
          6        ECHO                                                     '%3Cbr%3E'
   21     7      > RETURN                                                   null

End of function go

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.76 ms | 1396 KiB | 15 Q