<?php
class A
{
const cont = 'Using constant all the time';
function show() {
echo self::cont . "<br>";
}
}
echo "<font color='blue'>Printing the variable :</font>";
echo A::cont ;
echo "<br>";
echo "<font color='blue'> Creating Object :</font>";
$class = new A();
$class->show();
// echo $class::cont; is not allowed
?>
Class: Function:
'Using constant all the time self::cont