3v4l.org

run code in 500+ 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); $closureBar = (function (Foo $instance) { return $instance->bar; })->bindTo(null, Foo::class); $unBoundClosureBar = function (Foo $instance) { return $instance->bar; }; var_dump($reflectionBar->getValue($instance)); var_dump($closureBar($instance)); var_dump($unBoundClosureBar($instance));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GY4NC
function name:  (null)
number of ops:  38
compiled vars:  !0 = $instance, !1 = $reflectionBar, !2 = $closureBar, !3 = $unBoundClosureBar
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   27     0  E >   NEW                                                  $4      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $4
   29     3        NEW                                                  $7      'ReflectionProperty'
          4        SEND_VAL_EX                                                  'Foo'
          5        SEND_VAL_EX                                                  'bar'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $7
   30     8        INIT_METHOD_CALL                                             !1, 'setAccessible'
          9        SEND_VAL_EX                                                  <true>
         10        DO_FCALL                                          0          
   31    11        DECLARE_LAMBDA_FUNCTION                              ~11     [0]
   33    12        INIT_METHOD_CALL                                             ~11, 'bindTo'
         13        SEND_VAL_EX                                                  null
         14        SEND_VAL_EX                                                  'Foo'
         15        DO_FCALL                                          0  $12     
   31    16        ASSIGN                                                       !2, $12
   34    17        DECLARE_LAMBDA_FUNCTION                              ~14     [1]
         18        ASSIGN                                                       !3, ~14
   38    19        INIT_FCALL                                                   'var_dump'
         20        INIT_METHOD_CALL                                             !1, 'getValue'
         21        SEND_VAR_EX                                                  !0
         22        DO_FCALL                                          0  $16     
         23        SEND_VAR                                                     $16
         24        DO_ICALL                                                     
   39    25        INIT_FCALL                                                   'var_dump'
         26        INIT_DYNAMIC_CALL                                            !2
         27        SEND_VAR_EX                                                  !0
         28        DO_FCALL                                          0  $18     
         29        SEND_VAR                                                     $18
         30        DO_ICALL                                                     
   40    31        INIT_FCALL                                                   'var_dump'
         32        INIT_DYNAMIC_CALL                                            !3
         33        SEND_VAR_EX                                                  !0
         34        DO_FCALL                                          0  $20     
         35        SEND_VAR                                                     $20
         36        DO_ICALL                                                     
         37      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GY4NC
function name:  {closure:/in/GY4NC:31}
number of ops:  4
compiled vars:  !0 = $instance
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   31     0  E >   RECV                                                 !0      
   32     1        FETCH_OBJ_R                                          ~1      !0, 'bar'
          2      > RETURN                                                       ~1
   33     3*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GY4NC
function name:  {closure:/in/GY4NC:34}
number of ops:  4
compiled vars:  !0 = $instance
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   34     0  E >   RECV                                                 !0      
   35     1        FETCH_OBJ_R                                          ~1      !0, 'bar'
          2      > RETURN                                                       ~1
   36     3*     > RETURN                                                       null

End of Dynamic Function 1

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


preferences:
274.47 ms | 2302 KiB | 15 Q