3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __destruct() { throw new Exception('destruct A'); } } class B { private $m; public function __construct() { $this->m = new A(); } public function __destruct() { throw new Exception('destruct B'); } } try { $b = new B(); throw new Exception('throw'); } catch (Exception $e) { echo $e->getMessage(); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ci4Hr
function name:  (null)
number of ops:  13
compiled vars:  !0 = $b, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $2      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   27     3        NEW                                              $5      'Exception'
          4        SEND_VAL_EX                                              'throw'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $5
          7*       JMP                                                      ->12
   29     8  E > > CATCH                                       last         'Exception'
   30     9    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         10        DO_FCALL                                      0  $7      
         11        ECHO                                                     $7
   32    12      > RETURN                                                   1

Class A:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/Ci4Hr
function name:  __destruct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $0      'Exception'
          1        SEND_VAL_EX                                              'destruct+A'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
    7     4*     > RETURN                                                   null

End of function __destruct

End of class A.

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ci4Hr
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'm'
          3        OP_DATA                                                  $1
   17     4      > RETURN                                                   null

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/Ci4Hr
function name:  __destruct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $0      'Exception'
          1        SEND_VAL_EX                                              'destruct+B'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
   22     4*     > RETURN                                                   null

End of function __destruct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.78 ms | 1399 KiB | 13 Q