3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T{ private function random_method(){ echo "random method \n"; } } class A { use T; public function public_method(){ echo "public method\n"; } protected function protected_method(){ echo "protected method\n"; } private function private_method(){ echo "private method\n"; } } class B extends A{ public function random_method(){ echo "random method 2\n"; } public function protected_method(){ echo "protected method 2\n"; } public function private_method(){ echo "private method 2\n"; } public function public_method(){ echo "public method 2\n"; } } $b = new B; $b->protected_method(); $b->private_method(); $b->public_method(); $b->random_method();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LfYR9
function name:  (null)
number of ops:  14
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'a'
   24     1        DECLARE_CLASS                                            'b', 'a'
   39     2        NEW                                              $1      'B'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   41     5        INIT_METHOD_CALL                                         !0, 'protected_method'
          6        DO_FCALL                                      0          
   42     7        INIT_METHOD_CALL                                         !0, 'private_method'
          8        DO_FCALL                                      0          
   43     9        INIT_METHOD_CALL                                         !0, 'public_method'
         10        DO_FCALL                                      0          
   44    11        INIT_METHOD_CALL                                         !0, 'random_method'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

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

End of function random_method

End of class T.

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

End of function public_method

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

End of function protected_method

Function private_method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LfYR9
function name:  private_method
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ECHO                                                     'private+method%0A'
   21     1      > RETURN                                                   null

End of function private_method

End of class A.

Class B:
Function random_method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LfYR9
function name:  random_method
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   ECHO                                                     'random+method+2%0A'
   27     1      > RETURN                                                   null

End of function random_method

Function protected_method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LfYR9
function name:  protected_method
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   ECHO                                                     'protected+method+2%0A'
   30     1      > RETURN                                                   null

End of function protected_method

Function private_method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LfYR9
function name:  private_method
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   ECHO                                                     'private+method+2%0A'
   33     1      > RETURN                                                   null

End of function private_method

Function public_method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LfYR9
function name:  public_method
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   ECHO                                                     'public+method+2%0A'
   36     1      > RETURN                                                   null

End of function public_method

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.87 ms | 1399 KiB | 13 Q