3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public $bar; public function __destruct() { $r = new ReflectionClass($this->bar); $this->test(); var_dump($r, $this->bar); } public function test() { echo get_class($this->bar); } } $f = new foo; $f->bar = new StdClass; $f->bar->baz = $f; unset($f); //trigger destructor
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mbvoE
function name:  (null)
number of ops:  12
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        NEW                                              $5      'StdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               !0, 'bar'
          6        OP_DATA                                                  $5
   16     7        FETCH_OBJ_W                                      $7      !0, 'bar'
          8        ASSIGN_OBJ                                               $7, 'baz'
          9        OP_DATA                                                  !0
   17    10        UNSET_CV                                                 !0
         11      > RETURN                                                   1

Class foo:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mbvoE
function name:  __destruct
number of ops:  14
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $1      'ReflectionClass'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_OBJ_FUNC_ARG                               $2      'bar'
          3        SEND_FUNC_ARG                                            $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
    6     6        INIT_METHOD_CALL                                         'test'
          7        DO_FCALL                                      0          
    7     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        FETCH_OBJ_R                                      ~6      'bar'
         11        SEND_VAL                                                 ~6
         12        DO_ICALL                                                 
    8    13      > RETURN                                                   null

End of function __destruct

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mbvoE
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      'bar'
          1        GET_CLASS                                        ~1      ~0
          2        ECHO                                                     ~1
   11     3      > RETURN                                                   null

End of function test

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.69 ms | 1396 KiB | 15 Q