3v4l.org

run code in 300+ PHP versions simultaneously
<?php function save_order() { if(1==1){ throw new exception('caught exception'); } } function set_order_number() { echo 'SET_ORDER_NUMBER'.PHP_EOL; } function set_plan_id() { echo 'SET PLAN ID'.PHP_EOL; } try{ save_order(); //for testing purposed, guaranteed to throw exception set_order_number(); set_plan_id(); //WHY DOES THIS STILL EXECUTE? }catch(Exception $e){ header('Internal Server Error', true, 500); //echo http_response_code().PHP_EOL; echo json_encode(array('msg'=>$e->getMessage())); exit; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/uo812
function name:  (null)
number of ops:  22
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'save_order'
          1        DO_FCALL                                      0          
   19     2        INIT_FCALL                                               'set_order_number'
          3        DO_FCALL                                      0          
   20     4        INIT_FCALL                                               'set_plan_id'
          5        DO_FCALL                                      0          
          6      > JMP                                                      ->21
   21     7  E > > CATCH                                       last         'Exception'
   22     8    >   INIT_FCALL                                               'header'
          9        SEND_VAL                                                 'Internal+Server+Error'
         10        SEND_VAL                                                 <true>
         11        SEND_VAL                                                 500
         12        DO_ICALL                                                 
   24    13        INIT_FCALL                                               'json_encode'
         14        INIT_METHOD_CALL                                         !0, 'getMessage'
         15        DO_FCALL                                      0  $5      
         16        INIT_ARRAY                                       ~6      $5, 'msg'
         17        SEND_VAL                                                 ~6
         18        DO_ICALL                                         $7      
         19        ECHO                                                     $7
   25    20      > EXIT                                                     
   26    21    > > RETURN                                                   1

Function save_order:
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/uo812
function name:  save_order
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > JMPZ                                                     <true>, ->5
    5     1    >   NEW                                              $0      'exception'
          2        SEND_VAL_EX                                              'caught+exception'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $0
    7     5    > > RETURN                                                   null

End of function save_order

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

End of function set_order_number

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

End of function set_plan_id

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.53 ms | 1403 KiB | 20 Q