3v4l.org

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

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r4VHF
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

Function __isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r4VHF
function name:  __isset
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'Foo%3A%3A__isset'
          3        DO_ICALL                                                 
   16     4      > RETURN                                                   <true>
   17     5*     > RETURN                                                   null

End of function __isset

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r4VHF
function name:  __get
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'Foo%3A%3A__get'
          3        DO_ICALL                                                 
   23     4      > RETURN                                                   !0
   24     5*     > RETURN                                                   null

End of function __get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.63 ms | 1405 KiB | 15 Q