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 = [new Bar, '__invoke']; ($foo->callable)();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vl2fK
function name:  (null)
number of ops:  13
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        NEW                                              $5      'Bar'
          4        DO_FCALL                                      0          
          5        INIT_ARRAY                                       ~7      $5
          6        ADD_ARRAY_ELEMENT                                ~7      '__invoke'
          7        ASSIGN_OBJ                                               !0, 'callable'
          8        OP_DATA                                                  ~7
   18     9        FETCH_OBJ_R                                      ~8      !0, 'callable'
         10        INIT_DYNAMIC_CALL                                        ~8
         11        DO_FCALL                                      0          
         12      > 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/vl2fK
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:
161.56 ms | 1394 KiB | 13 Q