3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($b) { if ($b) throw new Exception("e"); } function g($b) { try { f($b); } catch (Exception $e) { } var_dump($e ? $e->getMessage() : null); } g(false); g(true);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fLVZL
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'g'
          1        SEND_VAL                                                 <false>
          2        DO_FCALL                                      0          
   21     3        INIT_FCALL                                               'g'
          4        SEND_VAL                                                 <true>
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function f:
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/fLVZL
function name:  f
number of ops:  7
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1      > JMPZ                                                     !0, ->6
          2    >   NEW                                              $1      'Exception'
          3        SEND_VAL_EX                                              'e'
          4        DO_FCALL                                      0          
          5      > THROW                                         0          $1
    6     6    > > RETURN                                                   null

End of function f

Function g:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
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
filename:       /in/fLVZL
function name:  g
number of ops:  16
compiled vars:  !0 = $b, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'f'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > JMP                                                      ->6
   14     5  E > > CATCH                                       last         'Exception'
   17     6    >   INIT_FCALL                                               'var_dump'
          7      > JMPZ                                                     !1, ->12
          8    >   INIT_METHOD_CALL                                         !1, 'getMessage'
          9        DO_FCALL                                      0  $3      
         10        QM_ASSIGN                                        ~4      $3
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~4      null
         13    >   SEND_VAL                                                 ~4
         14        DO_ICALL                                                 
   18    15      > RETURN                                                   null

End of function g

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.57 ms | 1394 KiB | 18 Q