3v4l.org

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

End of function set_plan_id

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.61 ms | 1394 KiB | 21 Q