3v4l.org

run code in 300+ PHP versions simultaneously
<?php pcntl_signal(SIGALRM, 'var_dump'); declare(ticks=100); class Task { public static function run() { $isActive = true; while ($isActive) { usleep(0.05*1e6); // complex business logic here echo "."; } } } Task::run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SX6NQ
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'pcntl_signal'
          1        FETCH_CONSTANT                                   ~0      'SIGALRM'
          2        SEND_VAL_EX                                              ~0
          3        SEND_VAL_EX                                              'var_dump'
          4        DO_FCALL                                      0          
    4     5        TICKS                                                    
   17     6        INIT_STATIC_METHOD_CALL                                  'Task', 'run'
          7        DO_FCALL                                      0          
          8        TICKS                                                    
          9      > RETURN                                                   1

Class Task:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/SX6NQ
function name:  run
number of ops:  12
compiled vars:  !0 = $isActive
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <true>
          1        TICKS                                                    
    9     2      > JMP                                                      ->9
   10     3    >   INIT_FCALL                                               'usleep'
          4        SEND_VAL                                                 50000
          5        DO_ICALL                                                 
          6        TICKS                                                    
   12     7        ECHO                                                     '.'
          8        TICKS                                                    
    9     9    > > JMPNZ                                                    !0, ->3
         10    >   TICKS                                                    
   14    11      > RETURN                                                   null

End of function run

End of class Task.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.79 ms | 1395 KiB | 15 Q