3v4l.org

run code in 300+ PHP versions simultaneously
<?php register_tick_function(function () { echo "Tick", PHP_EOL; throw new \Exception("Software interrupt"); }); declare(ticks=1) { try { $loopIndex = 0; while ($loopIndex < 1e3) { $loopIndex++; echo "Index {$loopIndex}", PHP_EOL; } } catch (\Exception $e) { echo "Received termination signal"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
Found catch point at position: 19
Branch analysis from position: 19
2 jumps found. (Code = 107) Position 1 = 20, Position 2 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/icq81
function name:  (null)
number of ops:  23
compiled vars:  !0 = $loopIndex, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'register_tick_function'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Ficq81%3A3%240'
    6     2        SEND_VAL                                                 ~2
          3        DO_ICALL                                                 
   11     4        ASSIGN                                                   !0, 0
          5        TICKS                                                    
   12     6      > JMP                                                      ->15
   13     7    >   PRE_INC                                                  !0
          8        TICKS                                                    
   14     9        NOP                                                      
         10        FAST_CONCAT                                      ~6      'Index+', !0
         11        ECHO                                                     ~6
         12        TICKS                                                    
         13        ECHO                                                     '%0A'
         14        TICKS                                                    
   12    15    >   IS_SMALLER                                               !0, 1000
         16      > JMPNZ                                                    ~7, ->7
         17    >   TICKS                                                    
         18      > JMP                                                      ->22
   16    19  E > > CATCH                                       last         'Exception'
   17    20    >   ECHO                                                     'Received+termination+signal'
         21        TICKS                                                    
   19    22    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Ficq81%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/icq81
function name:  {closure}
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'Tick'
          1        ECHO                                                     '%0A'
    5     2        NEW                                              $0      'Exception'
          3        SEND_VAL_EX                                              'Software+interrupt'
          4        DO_FCALL                                      0          
          5      > THROW                                         0          $0
    6     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Ficq81%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.71 ms | 1396 KiB | 15 Q