Advertisement
punjangga

Variabel statis 1

Dec 27th, 2016
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. <?php
  2. function test()
  3. {
  4. static $a=0;
  5. $a=$a+1;
  6. return "Mencoba pemanggilan ke-$a fungsi test() <br />";
  7. }
  8.  
  9. echo test();
  10. echo test();
  11. echo test();
  12. echo test();
  13. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement