3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $callable; } class Bar { public function __invoke() { echo 'DO IT'; } } $foo = new Foo; $foo->callable = [Bar, '__invoke']; ($foo->callable)();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ImKbv
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        FETCH_CONSTANT                                   ~5      'Bar'
          4        INIT_ARRAY                                       ~6      ~5
          5        ADD_ARRAY_ELEMENT                                ~6      '__invoke'
          6        ASSIGN_OBJ                                               !0, 'callable'
          7        OP_DATA                                                  ~6
   18     8        FETCH_OBJ_R                                      ~7      !0, 'callable'
          9        INIT_DYNAMIC_CALL                                        ~7
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class Foo: [no user functions]
Class Bar:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ImKbv
function name:  __invoke
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'DO+IT'
   13     1      > RETURN                                                   null

End of function __invoke

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.36 ms | 938 KiB | 14 Q