3v4l.org

run code in 500+ PHP versions simultaneously
<?php class x { private X $y; function __invoke() { echo __METHOD__;} function foo() { $this->y = new X; $this->y(); // better this way ($this->y)(); } } (new X)->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BtooN
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   NEW                                                  $0      'X'
          1        DO_FCALL                                          0          
          2        INIT_METHOD_CALL                                             $0, 'foo'
          3        DO_FCALL                                          0          
          4      > RETURN                                                       1

Class x:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BtooN
function name:  __invoke
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                         'x%3A%3A__invoke'
          1      > RETURN                                                       null

End of function __invoke

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BtooN
function name:  foo
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   NEW                                                  $1      'X'
          1        DO_FCALL                                          0          
          2        ASSIGN_OBJ                                                   'y'
          3        OP_DATA                                                      $1
   10     4        INIT_METHOD_CALL                                             'y'
          5        DO_FCALL                                          0          
   12     6        FETCH_OBJ_R                                          ~4      'y'
          7        INIT_DYNAMIC_CALL                                            ~4
          8        DO_FCALL                                          0          
   13     9      > RETURN                                                       null

End of function foo

End of class x.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
153.46 ms | 1484 KiB | 13 Q