Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php super

//Java = super
//PHP = parent

//Example
class ClassA
{
	public function methodA()
	{
		echo 'methodA working';
	}
}

class ClassB extends ClassA
{
    public function __construct()
    {
    	parent::methodA(); //super
    }
}

$classB = new ClassB();

//Output:
//methodA working
 
PREVIOUS NEXT
Tagged: #php #super
ADD COMMENT
Topic
Name
6+3 =