3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a() { return new Exception(); } function b() { $ex = a(); throw new Exception('message', 1337, $ex); } $ex = a(); echo (string)$ex; echo PHP_EOL . PHP_EOL . PHP_EOL; try { b(); } catch (Exception $ex) { echo (string)$ex; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 9
Branch analysis from position: 9
2 jumps found. (Code = 107) Position 1 = 10, Position 2 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/59F4S
function name:  (null)
number of ops:  13
compiled vars:  !0 = $ex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'a'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   13     3        CAST                                          6  ~3      !0
          4        ECHO                                                     ~3
   15     5        ECHO                                                     '%0A%0A%0A'
   18     6        INIT_FCALL                                               'b'
          7        DO_FCALL                                      0          
          8      > JMP                                                      ->12
   19     9  E > > CATCH                                       last         'Exception'
   20    10    >   CAST                                          6  ~5      !0
         11        ECHO                                                     ~5
   21    12    > > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/59F4S
function name:  a
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $0      'Exception'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    5     3*     > RETURN                                                   null

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/59F4S
function name:  b
number of ops:  10
compiled vars:  !0 = $ex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'a'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    9     3        NEW                                              $3      'Exception'
          4        SEND_VAL_EX                                              'message'
          5        SEND_VAL_EX                                              1337
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $3
   10     9*     > RETURN                                                   null

End of function b

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.27 ms | 1398 KiB | 16 Q