3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Print the value of $x every 10 statements register_tick_function ('printf', "The value of \$x is %d\n", &$x); declare (ticks=10) { for ($x = 1; $x <= 10; ++$x) { echo $x, "\n"; } } ?>
Output for 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated in /in/E4LEq on line 3 1 2 3 4 5 The value of $x is 5 6 7 8 9 10 The value of $x is 10

preferences:
155.01 ms | 995 KiB | 7 Q