3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar = 'bar'; public function __construct() { unset($this->bar); } } class Bar extends Foo { private $baz = 'baz'; private static $tab = 'tab'; public function __get(string $name) { var_dump($this->baz); var_dump(self::$tab); return $name; } } $r = new ReflectionProperty(Foo::class, 'bar'); $r->setAccessible(true); var_dump($r->getValue(new Bar));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dQlsf
function name:  (null)
number of ops:  17
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $1      'ReflectionProperty'
          1        SEND_VAL_EX                                              'Foo'
          2        SEND_VAL_EX                                              'bar'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   28     5        INIT_METHOD_CALL                                         !0, 'setAccessible'
          6        SEND_VAL_EX                                              <true>
          7        DO_FCALL                                      0          
   30     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !0, 'getValue'
         10        NEW                                              $5      'Bar'
         11        DO_FCALL                                      0          
         12        SEND_VAR_NO_REF_EX                                       $5
         13        DO_FCALL                                      0  $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dQlsf
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   UNSET_OBJ                                                'bar'
   10     1      > RETURN                                                   null

End of function __construct

End of class Foo.

Class Bar:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dQlsf
function name:  __get
number of ops:  11
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1        INIT_FCALL                                               'var_dump'
          2        FETCH_OBJ_R                                      ~1      'baz'
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
   21     5        INIT_FCALL                                               'var_dump'
          6        FETCH_STATIC_PROP_R          unknown             ~3      'tab'
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
   22     9      > RETURN                                                   !0
   23    10*     > RETURN                                                   null

End of function __get

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dQlsf
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   UNSET_OBJ                                                'bar'
   10     1      > RETURN                                                   null

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.29 ms | 1003 KiB | 14 Q