3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function __construct() { echo "Inside constructor\n"; throw new Exception; } function __destruct() { echo "Inside destructor\n"; } } try { $bar = new foo; } catch(Exception $exc) { echo "Caught exception!\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
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/o1104
function name:  (null)
number of ops:  7
compiled vars:  !0 = $bar, !1 = $exc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
          3      > JMP                                                      ->6
   14     4  E > > CATCH                                       last         'Exception'
   15     5    >   ECHO                                                     'Caught+exception%21%0A'
   16     6    > > RETURN                                                   1

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

End of function __construct

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

End of function __destruct

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.17 ms | 1394 KiB | 13 Q