3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CbMan { public function fn(callable $cb) { echo $cb(); } } class Pippo { public function yah() { return "hello world"; } } $methods = ['yah']; $cb = [new Pippo(), $methods]; $cbman = new CbMan(); $cbman->fn($cb);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JZJ84
function name:  (null)
number of ops:  13
compiled vars:  !0 = $methods, !1 = $cb, !2 = $cbman
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN                                                   !0, <array>
   20     1        NEW                                              $4      'Pippo'
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~6      $4
          4        ADD_ARRAY_ELEMENT                                ~6      !0
          5        ASSIGN                                                   !1, ~6
   22     6        NEW                                              $8      'CbMan'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $8
   23     9        INIT_METHOD_CALL                                         !2, 'fn'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class CbMan:
Function fn:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JZJ84
function name:  fn
number of ops:  5
compiled vars:  !0 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
    7     4      > RETURN                                                   null

End of function fn

End of class CbMan.

Class Pippo:
Function yah:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JZJ84
function name:  yah
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                   'hello+world'
   16     1*     > RETURN                                                   null

End of function yah

End of class Pippo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.95 ms | 1394 KiB | 13 Q