Guest User

Untitled

a guest
Aug 10th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. <?php
  2.  
  3. class Planet
  4. {
  5.     static $instances = 0;
  6.     public $instance;
  7.     public $size;
  8.  
  9.     public function __construct()
  10.     {
  11.         $this->instance = ++self::$instances;
  12.         $this->size = 25000;
  13.     }
  14.  
  15.     public function __clone()
  16.     {
  17.         $this->instance = ++self::$instances;
  18.     }
  19.  
  20.     public function getSize()
  21.     {
  22.         return $this->size;
  23.     }
  24. }
  25.  
  26. ?>
Add Comment
Please, Sign In to add comment