3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait MyTrait { protected function a() { var_dump(__METHOD__); } protected function b() { var_dump(__METHOD__); } } class MyClass { use MyTrait { a as protected; } public function __construct() { $this->a(); $this->b(); } } new MyClass();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VvUFL
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'myclass'
   20     1        NEW                                              $0      'MyClass'
          2        DO_FCALL                                      0          
          3        FREE                                                     $0
          4      > RETURN                                                   1

Class MyTrait:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VvUFL
function name:  a
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'MyTrait%3A%3Aa'
          2        DO_ICALL                                                 
    6     3      > RETURN                                                   null

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VvUFL
function name:  b
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'MyTrait%3A%3Ab'
          2        DO_ICALL                                                 
    9     3      > RETURN                                                   null

End of function b

End of class MyTrait.

Class MyClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VvUFL
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_METHOD_CALL                                         'a'
          1        DO_FCALL                                      0          
   17     2        INIT_METHOD_CALL                                         'b'
          3        DO_FCALL                                      0          
   18     4      > RETURN                                                   null

End of function __construct

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
131.36 ms | 1401 KiB | 15 Q