Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Counter{
- public static $v;
- public function add(){
- self::$v++;
- }
- public function get(){
- return self::$v;
- }
- }
- $a = new Counter();
- $a->add();
- $a->add();
- echo $a->get();
- $b = new Counter();
- $b->add();
- echo $b->get();
- die;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement