fork download
  1. <?php
  2.  
  3. function generator($start, $step) {
  4. static $start;
  5. return $start += $step;
  6. }
  7.  
  8. echo generator(2, 2);
  9. echo generator(2, 2);
  10. echo generator(2, 2);
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
246