3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait BazTrait { public function handle() { echo __CLASS__, static::class, PHP_EOL; } } class c1 { use BazTrait; public function do() { $this->handle(); } } class c2 { use BazTrait; public function do() { $this->handle(); } } class c3 extends c2 { } (new c1)->do(); (new c2)->do(); (new c3)->do();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PTqnX
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'c1'
   17     1        DECLARE_CLASS                                            'c2'
   23     2        DECLARE_CLASS                                            'c3', 'c2'
   28     3        NEW                                              $0      'c1'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $0, 'do'
          6        DO_FCALL                                      0          
   29     7        NEW                                              $3      'c2'
          8        DO_FCALL                                      0          
          9        INIT_METHOD_CALL                                         $3, 'do'
         10        DO_FCALL                                      0          
   30    11        NEW                                              $6      'c3'
         12        DO_FCALL                                      0          
         13        INIT_METHOD_CALL                                         $6, 'do'
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

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

End of function handle

End of class BazTrait.

Class c1:
Function do:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PTqnX
function name:  do
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_METHOD_CALL                                         'handle'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   null

End of function do

End of class c1.

Class c2:
Function do:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PTqnX
function name:  do
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_METHOD_CALL                                         'handle'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   null

End of function do

End of class c2.

Class c3: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.4 ms | 1008 KiB | 13 Q