/**
* Constant name shouldn't start with $
* Constant name may lower or uppercases.
* Same constant name can be used as a property name but must start with $ symbol.
* Constant doesn't available with $this-> inside class definition.
* Constant is available with self:: inside class definition.
* Constant can't call with $this-> outside class.
* Constant is accessible with :: after "Class Name or Object".
*
*/classMyClass{// Parse error: syntax error, unexpected '$CONSTANT' (T_VARIABLE), expecting identifier (T_STRING) in constant.php
//const $CONSTANT = 'constant named "CONSTANT" ';constCONSTANT='constant named "CONSTANT" ';
constsmall='constant named "small" ';
public$small='SAME CONTSNAT NAME AS PROPERTIES.';//Fatal error: Cannot redefine class constant MyClass::small in constant.php
// const small = 'constant named "small" ';functionshowConstant() {
echoself::CONSTANT."
";//echo $this->CONSTANT . "
"; // Notice: Undefined property: MyClass::$CONSTANT in constant.php}
}$class= newMyClass();$class->showConstant();//Notice: Undefined property: MyClass::$CONSTANT in constant.php
//echo $class->CONSTANT."
";echo$class->small."
";// SAME CONTSNAT NAME AS PROPERTIES.?>