3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $present=1; $min=1; $max=4; function sub() { global $present; global $max; global $min; if($present==$min) { $present=$max; } $present--; return $present; } echo sub();//it works only once echo sub(); echo sub(); ?>
Output for 4.3.0 - 7.1.0
321