3v4l.org

run code in 300+ PHP versions simultaneously
<?php function functionCall4() { if (true or mt_rand(1, 4) === 2) { throw new \Exception('exception'); } } function functionCall3() { functionCall4(); } function functionCall2() { functionCall3(); } function functionCall1() { try { functionCall2(); } catch (\Exception $e) { throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); } } try { functionCall1(); } catch (\RuntimeException $e) { echo 'Exception caught', PHP_EOL; while ($e) { echo 'Trace for ', get_class($e), "\n"; print_r($e->getTrace()); $e = $e->getPrevious(); } }
Finding entry points
Branch analysis from position: 0
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: 3
Branch analysis from position: 3
2 jumps found. (Code = 107) Position 1 = 4, Position 2 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 7
Branch analysis from position: 20
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 7
Branch analysis from position: 20
Branch analysis from position: 7
filename:       /in/vDt7v
function name:  (null)
number of ops:  21
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_FCALL                                               'functioncall1'
          1        DO_FCALL                                      0          
          2      > JMP                                                      ->20
   32     3  E > > CATCH                                       last         'RuntimeException'
   33     4    >   ECHO                                                     'Exception+caught'
          5        ECHO                                                     '%0A'
   34     6      > JMP                                                      ->19
   35     7    >   ECHO                                                     'Trace+for+'
          8        GET_CLASS                                        ~2      !0
          9        ECHO                                                     ~2
         10        ECHO                                                     '%0A'
   36    11        INIT_FCALL                                               'print_r'
         12        INIT_METHOD_CALL                                         !0, 'getTrace'
         13        DO_FCALL                                      0  $3      
         14        SEND_VAR                                                 $3
         15        DO_ICALL                                                 
   37    16        INIT_METHOD_CALL                                         !0, 'getPrevious'
         17        DO_FCALL                                      0  $5      
         18        ASSIGN                                                   !0, $5
   34    19    > > JMPNZ                                                    !0, ->7
   39    20    > > RETURN                                                   1

Function functioncall4:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 5
Branch analysis from position: 1
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vDt7v
function name:  functionCall4
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > JMPZ                                                     <true>, ->5
    7     1    >   NEW                                              $0      'Exception'
          2        SEND_VAL_EX                                              'exception'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $0
    9     5    > > RETURN                                                   null

End of function functioncall4

Function functioncall3:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vDt7v
function name:  functionCall3
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'functioncall4'
          1        DO_FCALL                                      0          
   14     2      > RETURN                                                   null

End of function functioncall3

Function functioncall2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vDt7v
function name:  functionCall2
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'functioncall3'
          1        DO_FCALL                                      0          
   19     2      > RETURN                                                   null

End of function functioncall2

Function functioncall1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 3
Branch analysis from position: 3
2 jumps found. (Code = 107) Position 1 = 4, Position 2 = -2
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/vDt7v
function name:  functionCall1
number of ops:  15
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'functioncall2'
          1        DO_FCALL                                      0          
          2      > JMP                                                      ->14
   25     3  E > > CATCH                                       last         'Exception'
   26     4    >   NEW                                              $2      'RuntimeException'
          5        INIT_METHOD_CALL                                         !0, 'getMessage'
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR_NO_REF_EX                                       $3
          8        INIT_METHOD_CALL                                         !0, 'getCode'
          9        DO_FCALL                                      0  $4      
         10        SEND_VAR_NO_REF_EX                                       $4
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
         13      > THROW                                         0          $2
   28    14    > > RETURN                                                   null

End of function functioncall1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.81 ms | 1005 KiB | 18 Q