3v4l.org

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

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

End of function test

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.65 ms | 1394 KiB | 13 Q