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 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 6
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 6
Branch analysis from position: 13
Branch analysis from position: 6
Found catch point at position: 14
Branch analysis from position: 14
2 jumps found. (Code = 107) Position 1 = 15, Position 2 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8tUIA
function name:  (null)
number of ops:  17
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%2F8tUIA%3A3%240'
    6     2        SEND_VAL                                                 ~2
          3        DO_ICALL                                                 
   11     4        ASSIGN                                                   !0, 0
   12     5      > JMP                                                      ->11
   13     6    >   PRE_INC                                                  !0
   14     7        NOP                                                      
          8        FAST_CONCAT                                      ~6      'Index+', !0
          9        ECHO                                                     ~6
         10        ECHO                                                     '%0A'
   12    11    >   IS_SMALLER                                               !0, 1000
         12      > JMPNZ                                                    ~7, ->6
         13    > > JMP                                                      ->16
   16    14  E > > CATCH                                       last         'Exception'
   17    15    >   ECHO                                                     'Received+termination+signal'
   19    16    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F8tUIA%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/8tUIA
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%2F8tUIA%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.45 ms | 1396 KiB | 15 Q