Class: Scopes resolution

Often you will need to refer the functions and variables in base classes,  without creating any instances or objects. The :: operator is being used for this. In the following example, we are using the base class very similar to Structure (Struct) in C++ programming. (Click Me)

<?php
// extneds is inhertance
class A {
public $something;
function example($test) {
$something= "Origininal";
echo " function A::example($test).<br />\n";
echo "$something <br>";
}
}

class B extends A {
function example($scale) {
echo " function B::example($scale).<br />\n";
//
A::example($scale);
}
}
// Here :: operator is used to call a function in class A
A::example("Scope Resolution");
$b = new B();
$b->example("Manas");

?>