3v4l.org

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

Class Foo:
Function do:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BFDL8
function name:  do
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'callable'
          1        INIT_DYNAMIC_CALL                                        ~0
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   10     4*     > RETURN                                                   null

End of function do

End of class Foo.

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

End of function __invoke

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.66 ms | 1394 KiB | 13 Q