3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $oink = 'foo'; } $foo = new Foo; class Bar extends Foo { public function __construct() { var_dump( get_object_vars($this), get_class($this), get_parent_class($this), $r = new ReflectionProperty($this, 'oink'), $r->getValue($this), $p = new ReflectionProperty(get_parent_class($this), 'oink'), $p->getValue($this) ); unset($this->oink); var_dump( get_object_vars($this), get_class($this), get_parent_class($this), $r = new ReflectionProperty($this, 'oink'), $r->getValue($this), $p = new ReflectionProperty(get_parent_class($this), 'oink'), $p->getValue($this) ); $this->oink = 'bar'; var_dump( get_object_vars($this), get_class($this), get_parent_class($this), $r = new ReflectionProperty($this, 'oink'), $r->getValue($this), $p = new ReflectionProperty(get_parent_class($this), 'oink'), $p->getValue($this) ); } } $bar = new Bar;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LbFki
function name:  (null)
number of ops:  7
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   52     3        NEW                                              $5      'Bar'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
          6      > RETURN                                                   1

Class Foo: [no user functions]
Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LbFki
function name:  __construct
number of ops:  130
compiled vars:  !0 = $r, !1 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
   16     1        INIT_FCALL                                               'get_object_vars'
          2        FETCH_THIS                                       ~2      
          3        SEND_VAL                                                 ~2
          4        DO_ICALL                                         $3      
          5        SEND_VAR                                                 $3
   17     6        FETCH_THIS                                       ~4      
          7        GET_CLASS                                        ~5      ~4
          8        SEND_VAL                                                 ~5
   18     9        INIT_FCALL                                               'get_parent_class'
         10        FETCH_THIS                                       ~6      
         11        SEND_VAL                                                 ~6
         12        DO_ICALL                                         $7      
         13        SEND_VAR                                                 $7
   19    14        NEW                                              $8      'ReflectionProperty'
         15        FETCH_THIS                                       $9      
         16        SEND_VAR_EX                                              $9
         17        SEND_VAL_EX                                              'oink'
         18        DO_FCALL                                      0          
         19        ASSIGN                                           ~11     !0, $8
         20        SEND_VAL                                                 ~11
   20    21        INIT_METHOD_CALL                                         !0, 'getValue'
         22        FETCH_THIS                                       $12     
         23        SEND_VAR_EX                                              $12
         24        DO_FCALL                                      0  $13     
         25        SEND_VAR                                                 $13
   21    26        NEW                                              $14     'ReflectionProperty'
         27        INIT_FCALL                                               'get_parent_class'
         28        FETCH_THIS                                       ~15     
         29        SEND_VAL                                                 ~15
         30        DO_ICALL                                         $16     
         31        SEND_VAR_NO_REF_EX                                       $16
         32        SEND_VAL_EX                                              'oink'
         33        DO_FCALL                                      0          
         34        ASSIGN                                           ~18     !1, $14
         35        SEND_VAL                                                 ~18
   22    36        INIT_METHOD_CALL                                         !1, 'getValue'
         37        FETCH_THIS                                       $19     
         38        SEND_VAR_EX                                              $19
         39        DO_FCALL                                      0  $20     
         40        SEND_VAR                                                 $20
         41        DO_ICALL                                                 
   25    42        UNSET_OBJ                                                'oink'
   27    43        INIT_FCALL                                               'var_dump'
   28    44        INIT_FCALL                                               'get_object_vars'
         45        FETCH_THIS                                       ~22     
         46        SEND_VAL                                                 ~22
         47        DO_ICALL                                         $23     
         48        SEND_VAR                                                 $23
   29    49        FETCH_THIS                                       ~24     
         50        GET_CLASS                                        ~25     ~24
         51        SEND_VAL                                                 ~25
   30    52        INIT_FCALL                                               'get_parent_class'
         53        FETCH_THIS                                       ~26     
         54        SEND_VAL                                                 ~26
         55        DO_ICALL                                         $27     
         56        SEND_VAR                                                 $27
   31    57        NEW                                              $28     'ReflectionProperty'
         58        FETCH_THIS                                       $29     
         59        SEND_VAR_EX                                              $29
         60        SEND_VAL_EX                                              'oink'
         61        DO_FCALL                                      0          
         62        ASSIGN                                           ~31     !0, $28
         63        SEND_VAL                                                 ~31
   32    64        INIT_METHOD_CALL                                         !0, 'getValue'
         65        FETCH_THIS                                       $32     
         66        SEND_VAR_EX                                              $32
         67        DO_FCALL                                      0  $33     
         68        SEND_VAR                                                 $33
   33    69        NEW                                              $34     'ReflectionProperty'
         70        INIT_FCALL                                               'get_parent_class'
         71        FETCH_THIS                                       ~35     
         72        SEND_VAL                                                 ~35
         73        DO_ICALL                                         $36     
         74        SEND_VAR_NO_REF_EX                                       $36
         75        SEND_VAL_EX                                              'oink'
         76        DO_FCALL                                      0          
         77        ASSIGN                                           ~38     !1, $34
         78        SEND_VAL                                                 ~38
   34    79        INIT_METHOD_CALL                                         !1, 'getValue'
         80        FETCH_THIS                                       $39     
         81        SEND_VAR_EX                                              $39
         82        DO_FCALL                                      0  $40     
         83        SEND_VAR                                                 $40
         84        DO_ICALL                                                 
   37    85        ASSIGN_OBJ                                               'oink'
         86        OP_DATA                                                  'bar'
   39    87        INIT_FCALL                                               'var_dump'
   40    88        INIT_FCALL                                               'get_object_vars'
         89        FETCH_THIS                                       ~43     
         90        SEND_VAL                                                 ~43
         91        DO_ICALL                                         $44     
         92        SEND_VAR                                                 $44
   41    93        FETCH_THIS                                       ~45     
         94        GET_CLASS                                        ~46     ~45
         95        SEND_VAL                                                 ~46
   42    96        INIT_FCALL                                               'get_parent_class'
         97        FETCH_THIS                                       ~47     
         98        SEND_VAL                                                 ~47
         99        DO_ICALL                                         $48     
        100        SEND_VAR                                                 $48
   43   101        NEW                                              $49     'ReflectionProperty'
        102        FETCH_THIS                                       $50     
        103        SEND_VAR_EX                                              $50
        104        SEND_VAL_EX                                              'oink'
        105        DO_FCALL                                      0          
        106        ASSIGN                                           ~52     !0, $49
        107        SEND_VAL                                                 ~52
   44   108        INIT_METHOD_CALL                                         !0, 'getValue'
        109        FETCH_THIS                                       $53     
        110        SEND_VAR_EX                                              $53
        111        DO_FCALL                                      0  $54     
        112        SEND_VAR                                                 $54
   45   113        NEW                                              $55     'ReflectionProperty'
        114        INIT_FCALL                                               'get_parent_class'
        115        FETCH_THIS                                       ~56     
        116        SEND_VAL                                                 ~56
        117        DO_ICALL                                         $57     
        118        SEND_VAR_NO_REF_EX                                       $57
        119        SEND_VAL_EX                                              'oink'
        120        DO_FCALL                                      0          
        121        ASSIGN                                           ~59     !1, $55
        122        SEND_VAL                                                 ~59
   46   123        INIT_METHOD_CALL                                         !1, 'getValue'
        124        FETCH_THIS                                       $60     
        125        SEND_VAR_EX                                              $60
        126        DO_FCALL                                      0  $61     
        127        SEND_VAR                                                 $61
        128        DO_ICALL                                                 
   49   129      > RETURN                                                   null

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.6 ms | 1404 KiB | 19 Q