3v4l.org

run code in 300+ PHP versions simultaneously
<?php class mc { public function go(array $arr) { array_walk($arr, array($this, "walkIt")); } private function walkIt($val) { echo $val . "<br />"; } public function export() { return array($this, 'walkIt'); } } $data = array(1,2,3,4); $m = new mc; $m->go($data); array_walk($data, $m->export());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tfh7f
function name:  (null)
number of ops:  14
compiled vars:  !0 = $data, !1 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, <array>
   19     1        NEW                                              $3      'mc'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   20     4        INIT_METHOD_CALL                                         !1, 'go'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   22     7        INIT_FCALL                                               'array_walk'
          8        SEND_REF                                                 !0
          9        INIT_METHOD_CALL                                         !1, 'export'
         10        DO_FCALL                                      0  $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class mc:
Function go:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tfh7f
function name:  go
number of ops:  9
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'array_walk'
          2        SEND_REF                                                 !0
          3        FETCH_THIS                                       ~1      
          4        INIT_ARRAY                                       ~2      ~1
          5        ADD_ARRAY_ELEMENT                                ~2      'walkIt'
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
    6     8      > RETURN                                                   null

End of function go

Function walkit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tfh7f
function name:  walkIt
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        CONCAT                                           ~1      !0, '%3Cbr+%2F%3E'
          2        ECHO                                                     ~1
   10     3      > RETURN                                                   null

End of function walkit

Function export:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tfh7f
function name:  export
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_THIS                                       ~0      
          1        INIT_ARRAY                                       ~1      ~0
          2        ADD_ARRAY_ELEMENT                                ~1      'walkIt'
          3      > RETURN                                                   ~1
   14     4*     > RETURN                                                   null

End of function export

End of class mc.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.51 ms | 1400 KiB | 15 Q