3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait PublicPropertyDeprecationTrait { public function accessPrivateProperty() { return $this->deprecatedPublicProperties['property']; } } class Foo { use PublicPropertyDeprecationTrait; private $deprecatedPublicProperties = [ 'property' => 'Foo', ]; } class Bar extends Foo { private $deprecatedPublicProperties = [ 'property' => 'Bar', ]; } $b = new Bar(); echo $b->accessPrivateProperty();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ejdue
function name:  (null)
number of ops:  9
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'foo'
   19     1        DECLARE_CLASS                                            'bar', 'foo'
   26     2        NEW                                              $1      'Bar'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   27     5        INIT_METHOD_CALL                                         !0, 'accessPrivateProperty'
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
          8      > RETURN                                                   1

Class PublicPropertyDeprecationTrait:
Function accessprivateproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ejdue
function name:  accessPrivateProperty
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_OBJ_R                                      ~0      'deprecatedPublicProperties'
          1        FETCH_DIM_R                                      ~1      ~0, 'property'
          2      > RETURN                                                   ~1
    8     3*     > RETURN                                                   null

End of function accessprivateproperty

End of class PublicPropertyDeprecationTrait.

Class Foo: [no user functions]
Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.3 ms | 1393 KiB | 13 Q