3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(tick=2) 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(); ?>
Output for 5.4.0 - 5.4.19
Warning: Unsupported declare 'tick' in /in/9Xcfp on line 2 Parse error: syntax error, unexpected 'tick_handler' (T_STRING), expecting '(' in /in/9Xcfp on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Warning: Unsupported declare 'tick' in /in/9Xcfp on line 2 Parse error: syntax error, unexpected T_STRING, expecting '(' in /in/9Xcfp on line 3
Process exited with code 255.

preferences:
181.08 ms | 1386 KiB | 55 Q