<?php
class resolution {
const CONST_VALUE = 'A constant value';
}
echo resolution::CONST_VALUE;
?>
<?php
class testClass extends resolution
{
public static $my_static = 'static variables';
public static function res_operator($value) {
echo "<br>";
echo parent::CONST_VALUE . " and local $value <br>";
echo self::$my_static . "<br>";
echo self::CONST_VALUE . "<br>";
}
}
//calling function, without creating an object
testClass::res_operator(15);
//creating an object to input different value
$t = new testClass();
$t->res_operator(10);
?>