there are three files: common.php, controller.php and user.php.
File common.php looks like:
<?php
define("MAXIMUM_NAME_LENGTH", 50);
?>
File controller.php looks like:
<?php
include("common.php");
include("user.php");
$user = new user();
?>
File user.php looks like:
<?php
class user{
private $var = MAXIMUM_NAME_LENGTH;
}
?>
When executing script there is given notice: Notice: Use of undefined constant MAXIMUM_NAME_LENGTH - assumed 'MAXIMUM_NAME_LENGTH' in /.../controller.php on line xxx. I want to share defined values in common.php between other files. How to do it in a proper way?