3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL|E_STRICT); function do_test(): int { try { 1/0; // a warning in php 7 - reported as documented nonexistent_function(); // a fatal error - not reported - program continues 1%0; // a fatal error return 0; } catch (Throwable $t) { printf("CATCH\n"); return 1; } finally { printf("FINALLY\n"); return 2; } return 3; } printf("%d\n", do_test());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6N4d9
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
   18     3        INIT_FCALL                                               'printf'
          4        SEND_VAL                                                 '%25d%0A'
          5        INIT_FCALL                                               'do_test'
          6        DO_FCALL                                      0  $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function do_test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
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
2 jumps found. (Code = 162) Position 1 = 17, Position 2 = 14
Branch analysis from position: 17
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6N4d9
function name:  do_test
number of ops:  26
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DIV                                              ~2      1, 0
          1        FREE                                                     ~2
    6     2        INIT_FCALL_BY_NAME                                       'nonexistent_function'
          3        DO_FCALL                                      0          
    7     4        MOD                                              ~4      1, 0
          5        FREE                                                     ~4
    8     6      > FAST_CALL                                                ->17
          7    > > RETURN                                                   0
          8*       JMP                                                      ->15
    9     9  E > > CATCH                                       last         'Throwable'
   10    10    >   INIT_FCALL                                               'printf'
         11        SEND_VAL                                                 'CATCH%0A'
         12        DO_ICALL                                                 
   11    13      > FAST_CALL                                                ->17
         14    > > RETURN                                                   1
   12    15*       FAST_CALL                                                ->17
         16*       JMP                                                      ->23
   13    17    >   INIT_FCALL                                               'printf'
         18        SEND_VAL                                                 'FINALLY%0A'
         19        DO_ICALL                                                 
   14    20        DISCARD_EXCEPTION                                        
         21      > RETURN                                                   2
         22*       FAST_RET                                                 
   16    23*       RETURN                                                   3
   17    24*       VERIFY_RETURN_TYPE                                       
         25*     > RETURN                                                   null

End of function do_test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.3 ms | 1008 KiB | 16 Q