3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c1 { public function test() { echo 'c1<br />'; return [1]; } } trait t1 { public function rules() { return [2]; } } trait t2 { public function rules() { return [3]; } } class c2 extends c1 { use t1, t2 { t1::rules as t1Rules; t2::rules as t2Rules; } public function test() { echo 'c2<br />'; return array_merge(parent::test(), t1Rules(), t2Rules(), [4]); } } $obj = new c2(); echo '<pre>'; print_r($obj->test());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Gu5l
function name:  (null)
number of ops:  11
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   DECLARE_CLASS                                            'c2', 'c1'
   33     1        NEW                                              $1      'c2'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   34     4        ECHO                                                     '%3Cpre%3E'
   35     5        INIT_FCALL                                               'print_r'
          6        INIT_METHOD_CALL                                         !0, 'test'
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class c1:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Gu5l
function name:  test
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'c1%3Cbr+%2F%3E'
    5     1      > RETURN                                                   <array>
    6     2*     > RETURN                                                   null

End of function test

End of class c1.

Class t1:
Function rules:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Gu5l
function name:  rules
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   <array>
   12     1*     > RETURN                                                   null

End of function rules

End of class t1.

Class t2:
Function rules:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Gu5l
function name:  rules
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E > > RETURN                                                   <array>
   18     1*     > RETURN                                                   null

End of function rules

End of class t2.

Class c2:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Gu5l
function name:  test
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   ECHO                                                     'c2%3Cbr+%2F%3E'
   29     1        INIT_FCALL                                               'array_merge'
          2        INIT_STATIC_METHOD_CALL                                  'test'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        INIT_FCALL_BY_NAME                                       't1Rules'
          6        DO_FCALL                                      0  $1      
          7        SEND_VAR                                                 $1
          8        INIT_FCALL_BY_NAME                                       't2Rules'
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        SEND_VAL                                                 <array>
         12        DO_ICALL                                         $3      
         13      > RETURN                                                   $3
   30    14*     > RETURN                                                   null

End of function test

End of class c2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.12 ms | 1400 KiB | 17 Q