According to https://www.tutorialspoint.com/php/php_constants.htm a normal costant is define by using define() function plus a value:
define('TEST', 123);
I think it would be interesting and useful if there were a way to define a constant with a function inside:
define ('ME', function($test){
if($test == true){
return "Whats up";
}else{
return "whats down";
}
});
Then perhaps I could do something like this?
if($I_Said === ME($val)){
do something;
}
Is there a such a way to do this?