3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $m_bThrow = FALSE; public function __construct($bThrow) { $this->m_bThrow = $bThrow; } public function __destruct() { if ($this->m_bThrow) { throw new Exception('Exception in destructor!'); } } } function abc2() { $a = new A(TRUE); throw new Exception('manual exception'); } try { abc2(); echo 'Unexpected no exception!' . "\n"; } catch (Exception $e) { echo $e->getMessage() . "\n"; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 4
Branch analysis from position: 4
2 jumps found. (Code = 107) Position 1 = 5, Position 2 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tRiBB
function name:  (null)
number of ops:  10
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'abc2'
          1        DO_FCALL                                      0          
   28     2        ECHO                                                     'Unexpected+no+exception%21%0A'
          3      > JMP                                                      ->9
   30     4  E > > CATCH                                       last         'Exception'
   31     5    >   INIT_METHOD_CALL                                         !0, 'getMessage'
          6        DO_FCALL                                      0  $2      
          7        CONCAT                                           ~3      $2, '%0A'
          8        ECHO                                                     ~3
   33     9    > > RETURN                                                   1

Function abc2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/tRiBB
function name:  abc2
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'A'
          1        SEND_VAL_EX                                              <true>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   23     4        NEW                                              $4      'Exception'
          5        SEND_VAL_EX                                              'manual+exception'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $4
   24     8*     > RETURN                                                   null

End of function abc2

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

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tRiBB
function name:  __destruct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'm_bThrow'
          1      > JMPZ                                                     ~0, ->6
   15     2    >   NEW                                              $1      'Exception'
          3        SEND_VAL_EX                                              'Exception+in+destructor%21'
          4        DO_FCALL                                      0          
          5      > THROW                                         0          $1
   17     6    > > RETURN                                                   null

End of function __destruct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.48 ms | 1403 KiB | 14 Q