3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait T1 { function a1() { return $this->var; } } trait T2 { use T1; function a2() { return $this->a1(); } } class A { use T2; protected $var = 3; } $a = new A; echo $a->a2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TNcVA
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                                't2'
   14     1        DECLARE_CLASS                                                'a'
   19     2        NEW                                                  $1      'A'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $1
   20     5        INIT_METHOD_CALL                                             !0, 'a2'
          6        DO_FCALL                                          0  $4      
          7        ECHO                                                         $4
          8      > RETURN                                                       1

Class T1:
Function a1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TNcVA
function name:  a1
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   FETCH_OBJ_R                                          ~0      'var'
          1      > RETURN                                                       ~0
    6     2*     > RETURN                                                       null

End of function a1

End of class T1.

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

End of function a2

End of class T2.

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160 ms | 2900 KiB | 13 Q