3v4l.org

run code in 300+ PHP versions simultaneously
<?php function runUntilExceptionsStop(callable $fn, $maxRuns=5) { $done = false; $runs = 0; do { try { $fn(); // however you want to call fn $done = true; } catch( \Exception $e ) { $runs++; } } while( $runs < $maxRuns || !$done ); } runUntilExceptionsStop( function(){echo 'h';},5);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5btJo
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'rununtilexceptionsstop'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F5btJo%3A16%240'
          2        SEND_VAL                                                 ~0
          3        SEND_VAL                                                 5
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function rununtilexceptionsstop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 4
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
Branch analysis from position: 14
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
Branch analysis from position: 14
filename:       /in/5btJo
function name:  runUntilExceptionsStop
number of ops:  16
compiled vars:  !0 = $fn, !1 = $maxRuns, !2 = $done, !3 = $runs, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      5
    4     2        ASSIGN                                                   !2, <false>
    5     3        ASSIGN                                                   !3, 0
    8     4    >   INIT_DYNAMIC_CALL                                        !0
          5        DO_FCALL                                      0          
    9     6        ASSIGN                                                   !2, <true>
          7      > JMP                                                      ->10
   10     8  E > > CATCH                                       last         'Exception'
   11     9    >   PRE_INC                                                  !3
   13    10    >   IS_SMALLER                                       ~10     !3, !1
         11      > JMPNZ_EX                                         ~10     ~10, ->14
         12    >   BOOL_NOT                                         ~11     !2
         13        BOOL                                             ~10     ~11
         14    > > JMPNZ                                                    ~10, ->4
   14    15    > > RETURN                                                   null

End of function rununtilexceptionsstop

Function %00%7Bclosure%7D%2Fin%2F5btJo%3A16%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5btJo
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'h'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F5btJo%3A16%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.65 ms | 1390 KiB | 14 Q