3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(ticks=1); function tick_handler() { echo "tick_handler() called\n"; } register_tick_function('tick_handler'); $a = 1; tick_handler(); if ($a > 0) { $a += 2; tick_handler(); print($a); tick_handler(); } tick_handler(); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/5kMmS
function name:  (null)
number of ops:  26
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   TICKS                                                    
    7     1        INIT_FCALL                                               'register_tick_function'
          2        SEND_VAL                                                 'tick_handler'
          3        DO_ICALL                                                 
          4        TICKS                                                    
    8     5        ASSIGN                                                   !0, 1
          6        TICKS                                                    
    9     7        INIT_FCALL                                               'tick_handler'
          8        DO_FCALL                                      0          
          9        TICKS                                                    
   11    10        IS_SMALLER                                               0, !0
         11      > JMPZ                                                     ~4, ->22
   12    12    >   ASSIGN_OP                                     1          !0, 2
         13        TICKS                                                    
   13    14        INIT_FCALL                                               'tick_handler'
         15        DO_FCALL                                      0          
         16        TICKS                                                    
   14    17        ECHO                                                     !0
         18        TICKS                                                    
   15    19        INIT_FCALL                                               'tick_handler'
         20        DO_FCALL                                      0          
         21        TICKS                                                    
   17    22    >   INIT_FCALL                                               'tick_handler'
         23        DO_FCALL                                      0          
         24        TICKS                                                    
   19    25      > RETURN                                                   1

Function tick_handler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5kMmS
function name:  tick_handler
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'tick_handler%28%29+called%0A'
          1        TICKS                                                    
    6     2      > RETURN                                                   null

End of function tick_handler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.08 ms | 1399 KiB | 19 Q