3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait ProtectedTestTrait { protected $test; } class ProtectedTestBase { use ProtectedTestTrait; } class ProtectedTestChild extends ProtectedTestBase { public function execute() { $this->test = 'blah'; } } $protectedChild = new ProtectedTestChild(); echo $protectedChild->execute(); var_dump($protectedChild);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XYPvd
function name:  (null)
number of ops:  12
compiled vars:  !0 = $protectedChild
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'protectedtestbase'
   11     1        DECLARE_CLASS                                            'protectedtestchild', 'protectedtestbase'
   18     2        NEW                                              $1      'ProtectedTestChild'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   19     5        INIT_METHOD_CALL                                         !0, 'execute'
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
   21     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class ProtectedTestTrait: [no user functions]
Class ProtectedTestBase: [no user functions]
Class ProtectedTestChild:
Function execute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XYPvd
function name:  execute
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN_OBJ                                               'test'
          1        OP_DATA                                                  'blah'
   15     2      > RETURN                                                   null

End of function execute

End of class ProtectedTestChild.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.96 ms | 1395 KiB | 15 Q