3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $m; public function __destruct() { throw new Exception('destruct A'); } } class B { public function abc() { $a = new A(); } public function __destruct() { throw new Exception('destruct B'); } } try { try { { $b = new B(); try { $b->abc(); } catch (Exception $e) { echo $e->getMessage(); } # unset($b); } } catch (Exception $e) { echo $e->getMessage(); } } catch (Exception $e) { echo $e->getMessage(); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Found catch point at position: 11
Branch analysis from position: 11
2 jumps found. (Code = 107) Position 1 = 12, Position 2 = -2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Found catch point at position: 16
Branch analysis from position: 16
2 jumps found. (Code = 107) Position 1 = 17, Position 2 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jaloa
function name:  (null)
number of ops:  21
compiled vars:  !0 = $b, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $2      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   33     3        INIT_METHOD_CALL                                         !0, 'abc'
          4        DO_FCALL                                      0          
          5      > JMP                                                      ->10
   36     6  E > > CATCH                                       last         'Exception'
   37     7    >   INIT_METHOD_CALL                                         !1, 'getMessage'
          8        DO_FCALL                                      0  $6      
          9        ECHO                                                     $6
         10    > > JMP                                                      ->15
   43    11  E > > CATCH                                       last         'Exception'
   44    12    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         13        DO_FCALL                                      0  $7      
         14        ECHO                                                     $7
         15    > > JMP                                                      ->20
   47    16  E > > CATCH                                       last         'Exception'
   48    17    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         18        DO_FCALL                                      0  $8      
         19        ECHO                                                     $8
   51    20    > > RETURN                                                   1

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

End of function __destruct

End of class A.

Class B:
Function abc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jaloa
function name:  abc
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3      > RETURN                                                   null

End of function abc

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

End of function __destruct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.39 ms | 1399 KiB | 13 Q