3v4l.org

run code in 500+ PHP versions simultaneously
<?php class foo { function bar(callable $callable) { $callable(); } function printStr() { echo "hi"; } } $foo = new foo(); $foo->bar([$foo, 'printStr']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8DLkF
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   NEW                                                  $1      'foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   14     3        INIT_METHOD_CALL                                             !0, 'bar'
          4        INIT_ARRAY                                           ~4      !0
          5        ADD_ARRAY_ELEMENT                                    ~4      'printStr'
          6        SEND_VAL_EX                                                  ~4
          7        DO_FCALL                                          0          
          8      > RETURN                                                       1

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

End of function bar

Function printstr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8DLkF
function name:  printStr
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                         'hi'
   10     1      > RETURN                                                       null

End of function printstr

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.9 ms | 1578 KiB | 13 Q