Example #1
0
    {
        $this->prop1 = $newVal;
    }
    private function getProperty()
    {
        return $this->prop1 . "<br />";
    }
    public static function plusOne()
    {
        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 />";
    }
    public function callProtected()
    {
        return $this->getProperty();
    }
}
do {
    echo MyClass::plusOne();
} while (MyClass::$count < 10);