return "The count is " . ++self::$count . "<br />"; } } class myOtherClass extends myClass { public function __construct() { parent::__construct(); echo "A new constructor in " . __CLASS__ . "<br />"; } public function newMethod() { echo "From a new method in " . __CLASS__ . "<br />"; } } /* $obj = new myClass; var_dump($obj); echo $obj->getProperty(); echo $obj; unset($obj); echo "End of file.<br />"; */ /* $newobj = new myOtherClass; echo $newobj->newMethod(); echo $newobj->getProperty(); */ do { echo myClass::plusOne(); } while (myClass::$count < 10);