Advertisement
villers

Untitled

Sep 11th, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. <?php
  2.  
  3. // opti
  4. $count = 0;
  5. function return_calls(){
  6.     global $count;
  7.     $count++;
  8.     return ($count  % 3 == 0)? $count : null;
  9. }
  10.  
  11.  
  12. // opti
  13. function return_calls(){
  14.     static $count = 0;
  15.     $count++;
  16.     return ($count  % 3 == 0)? $count : null;
  17. }
  18.  
  19. function return_calls(){
  20.     static $count = 0;
  21.     $count++;
  22.     if($count  % 3 == 0){
  23.         return $count;
  24.     }
  25.     else{
  26.         return null;
  27.     }
  28. }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement