3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ClassName { public function __construct() { echo 'object begin' . PHP_EOL; throw new Exception('!! Exception !!'); echo 'object after thow' . PHP_EOL; } public function __destruct() { echo 'object end' . PHP_EOL; } } echo '<< script begin >>' . PHP_EOL; try { $o = new ClassName; } catch (Exception $e) { echo $e->getMessage() . PHP_EOL; } finally { echo 'finally block, object ' (isset($o) ? 'exist' :'not exist') . PHP_EOL; } echo '<< script end >>' . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 162) Position 1 = 12, Position 2 = 11
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
2 jumps found. (Code = 162) Position 1 = 12, Position 2 = 11
Branch analysis from position: 12
Branch analysis from position: 11
filename:       /in/D7OZV
function name:  (null)
number of ops:  25
compiled vars:  !0 = $o, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ECHO                                                     '%3C%3C+script+begin+%3E%3E%0A'
   21     1        NEW                                              $3      'ClassName'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
          4      > JMP                                                      ->10
   22     5  E > > CATCH                                       last         'Exception'
   23     6    >   INIT_METHOD_CALL                                         !1, 'getMessage'
          7        DO_FCALL                                      0  $6      
          8        CONCAT                                           ~7      $6, '%0A'
          9        ECHO                                                     ~7
   24    10    > > FAST_CALL                                                ->12
         11    > > JMP                                                      ->23
   25    12    >   INIT_FCALL_BY_NAME                                       'finally+block%2C+object+'
         13        ISSET_ISEMPTY_CV                                         !0
         14      > JMPZ                                                     ~8, ->17
         15    >   QM_ASSIGN                                        ~9      'exist'
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~9      'not+exist'
         18    >   SEND_VAL_EX                                              ~9
         19        DO_FCALL                                      0  $10     
         20        CONCAT                                           ~11     $10, '%0A'
         21        ECHO                                                     ~11
         22      > FAST_RET                                                 
   28    23    >   ECHO                                                     '%3C%3C+script+end+%3E%3E%0A'
         24      > RETURN                                                   1

Class ClassName:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/D7OZV
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'object+begin%0A'
    8     1        NEW                                              $0      'Exception'
          2        SEND_VAL_EX                                              '%21%21+Exception+%21%21'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $0
    9     5*       ECHO                                                     'object+after+thow%0A'
   10     6*     > 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/D7OZV
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'object+end%0A'
   15     1      > RETURN                                                   null

End of function __destruct

End of class ClassName.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.04 ms | 1399 KiB | 13 Q