3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait behaviour { protected $_test = 1; } class A { use behaviour; } class B extends A { public function getTest(){ return $this->_test; } } echo (new B)->getTest();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jcm4I
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'a'
   11     1        DECLARE_CLASS                                            'b', 'a'
   17     2        NEW                                              $0      'B'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'getTest'
          5        DO_FCALL                                      0  $2      
          6        ECHO                                                     $2
          7      > RETURN                                                   1

Class behaviour: [no user functions]
Class A: [no user functions]
Class B:
Function gettest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jcm4I
function name:  getTest
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~0      '_test'
          1      > RETURN                                                   ~0
   14     2*     > RETURN                                                   null

End of function gettest

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.93 ms | 1393 KiB | 13 Q