3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace igorw; class FailingTooHardException extends \Exception {} function retry($retries, callable $fn) { beginning: try { return $fn(); } catch (\Exception $e) { switch ($retries) { case 0: throw new FailingTooHardException('', 0, $e); break; case 1: try { return $fn(); } catch (\Exception $e) { throw new FailingTooHardException('', 0, $e); } break; case 2: try { return $fn(); } catch (\Exception $e) { try { return $fn(); } catch (\Exception $e) { throw new FailingTooHardException('', 0, $e); } } break; case 3: try { return $fn(); } catch (\Exception $e) { try { return $fn(); } catch (\Exception $e) { try { return $fn(); } catch (\Exception $e) { throw new FailingTooHardException('', 0, $e); } } } break; default: $retries--; goto beginning; break; } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j430f
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E > > RETURN                                                   1

Function igorw%5Cretry:
Finding entry points
Branch analysis from position: 0
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
6 jumps found. (Code = 187) Position 1 = 18, Position 2 = 25, Position 3 = 37, Position 4 = 54, Position 5 = 76, Position 6 = 9
Branch analysis from position: 18
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 76
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 37
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 54
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 54
Branch analysis from position: 37
Branch analysis from position: 25
Branch analysis from position: 18
Found catch point at position: 29
Branch analysis from position: 29
2 jumps found. (Code = 107) Position 1 = 30, Position 2 = -2
Branch analysis from position: 30
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 41
Branch analysis from position: 41
2 jumps found. (Code = 107) Position 1 = 42, Position 2 = -2
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 46
Branch analysis from position: 46
2 jumps found. (Code = 107) Position 1 = 47, Position 2 = -2
Branch analysis from position: 47
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 58
Branch analysis from position: 58
2 jumps found. (Code = 107) Position 1 = 59, Position 2 = -2
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 63
Branch analysis from position: 63
2 jumps found. (Code = 107) Position 1 = 64, Position 2 = -2
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 68
Branch analysis from position: 68
2 jumps found. (Code = 107) Position 1 = 69, Position 2 = -2
Branch analysis from position: 69
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/j430f
function name:  igorw\retry
number of ops:  80
compiled vars:  !0 = $retries, !1 = $fn, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2    >   NOP                                                      
   11     3        INIT_DYNAMIC_CALL                                        !1
          4        DO_FCALL                                      0  $3      
          5      > RETURN                                                   $3
          6*       JMP                                                      ->79
   12     7  E > > CATCH                                       last         'Exception'
   13     8    > > SWITCH_LONG                                              !0, [ 0:->18, 1:->25, 2:->37, 3:->54, ], ->76
   14     9    >   IS_EQUAL                                                 !0, 0
         10      > JMPNZ                                                    ~4, ->18
   17    11    >   IS_EQUAL                                                 !0, 1
         12      > JMPNZ                                                    ~4, ->25
   24    13    >   IS_EQUAL                                                 !0, 2
         14      > JMPNZ                                                    ~4, ->37
   35    15    >   IS_EQUAL                                                 !0, 3
         16      > JMPNZ                                                    ~4, ->54
         17    > > JMP                                                      ->76
   15    18    >   NEW                                              $5      'igorw%5CFailingTooHardException'
         19        SEND_VAL_EX                                              ''
         20        SEND_VAL_EX                                              0
         21        SEND_VAR_EX                                              !2
         22        DO_FCALL                                      0          
         23      > THROW                                         0          $5
   16    24*       JMP                                                      ->79
   19    25    >   INIT_DYNAMIC_CALL                                        !1
         26        DO_FCALL                                      0  $7      
         27      > RETURN                                                   $7
         28*       JMP                                                      ->36
   20    29  E > > CATCH                                       last         'Exception'
   21    30    >   NEW                                              $8      'igorw%5CFailingTooHardException'
         31        SEND_VAL_EX                                              ''
         32        SEND_VAL_EX                                              0
         33        SEND_VAR_EX                                              !2
         34        DO_FCALL                                      0          
         35      > THROW                                         0          $8
   23    36*       JMP                                                      ->79
   26    37    >   INIT_DYNAMIC_CALL                                        !1
         38        DO_FCALL                                      0  $10     
         39      > RETURN                                                   $10
         40*       JMP                                                      ->53
   27    41  E > > CATCH                                       last         'Exception'
   29    42    >   INIT_DYNAMIC_CALL                                        !1
         43        DO_FCALL                                      0  $11     
         44      > RETURN                                                   $11
         45*       JMP                                                      ->53
   30    46  E > > CATCH                                       last         'Exception'
   31    47    >   NEW                                              $12     'igorw%5CFailingTooHardException'
         48        SEND_VAL_EX                                              ''
         49        SEND_VAL_EX                                              0
         50        SEND_VAR_EX                                              !2
         51        DO_FCALL                                      0          
         52      > THROW                                         0          $12
   34    53*       JMP                                                      ->79
   37    54    >   INIT_DYNAMIC_CALL                                        !1
         55        DO_FCALL                                      0  $14     
         56      > RETURN                                                   $14
         57*       JMP                                                      ->75
   38    58  E > > CATCH                                       last         'Exception'
   40    59    >   INIT_DYNAMIC_CALL                                        !1
         60        DO_FCALL                                      0  $15     
         61      > RETURN                                                   $15
         62*       JMP                                                      ->75
   41    63  E > > CATCH                                       last         'Exception'
   43    64    >   INIT_DYNAMIC_CALL                                        !1
         65        DO_FCALL                                      0  $16     
         66      > RETURN                                                   $16
         67*       JMP                                                      ->75
   44    68  E > > CATCH                                       last         'Exception'
   45    69    >   NEW                                              $17     'igorw%5CFailingTooHardException'
         70        SEND_VAL_EX                                              ''
         71        SEND_VAL_EX                                              0
         72        SEND_VAR_EX                                              !2
         73        DO_FCALL                                      0          
         74      > THROW                                         0          $17
   49    75*       JMP                                                      ->79
   51    76    >   PRE_DEC                                                  !0
   52    77      > JMP                                                      ->2
   53    78*       JMP                                                      ->79
   56    79*     > RETURN                                                   null

End of function igorw%5Cretry

Class igorw\FailingTooHardException: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.24 ms | 1403 KiB | 13 Q