java
html
php
c
ajax
database
xcode
mysql
objective-c
multithreading
flash
perl
algorithm
facebook
oracle
cocoa
php5
asp
jsp
dom
Just reference them in any class using $this.
$this
class MyClassD extends MyClassC { function __construct() { echo $this->variableA; echo $this->variableB; } } $var = new MyClassD;
See it work!
Since variableA is public in the base class, you can just access it directly like so: $MyClassDObj->variableB.
variableA
$MyClassDObj->variableB
Since variableA is protected, you need to write a getter if you wanted to access it from outside the class, otherwise from within class D, you can access it just like variableB. A getter would look like this:
public function getVariableA() { return $this->variableA; }
And then you call $MyClassDObj->getVariableA();
$MyClassDObj->getVariableA()
Just like you'd get it from MyClassA.