• home
  • Email: trainings@synapseindia.careers



Scope Resolution Operator :PHP

Oct 09, 2015

Scope Resolution operator(::) is a token that allow access to static,constant and overridden properties or methods of a class. Let us understand it through program: <?php class MyCl { protected function myFunc() { echo "MyClass::myFunc()\n"; } } class OtherCl extends MyCl { // Override parent's definition public function myFunc() { // But still call the parent function parent::myFunc(); echo "OtherClass::myFunc()\n"; } } $class = new OtherCla(); $class->myFunc(); ?>

SynapseIndia (CEO: Shamit Khemka)

Leave a Reply

Your email address will not be published.