3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function __destruct() { echo 'peng'; } } class Test2 { private $test; public function __construct(Test $test) { $this->test = $test; } } $test = new Test(); $test = new stdClass;//Test2($test); echo 'predestruct';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H0pWL
function name:  (null)
number of ops:  8
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        NEW                                              $4      'stdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $4
   23     6        ECHO                                                     'predestruct'
          7      > RETURN                                                   1

Class Test:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H0pWL
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'peng'
    8     1      > RETURN                                                   null

End of function __destruct

End of class Test.

Class Test2:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H0pWL
function name:  __construct
number of ops:  4
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        ASSIGN_OBJ                                               'test'
          2        OP_DATA                                                  !0
   18     3      > RETURN                                                   null

End of function __construct

End of class Test2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.87 ms | 1394 KiB | 13 Q