I’ve been using variables to store many things that should probably be stored as constants since they should never change. However, I once read in the documentation that array values are allowed since PHP 7.0.0. That made me think that are objects like class-instances or functions or… definable as constants in PHP? define("MY_CONSTANT", "myString"); // ..
I have a file with a variable name $myCODE with some values. The current code prints $myCODE and I have assigned different values to it after that which is being printed. Now I want to read the file perhaps using get_defined_vars() and want to assign first instance of the code as $myCODE1 and the 2nd ..
I have some php code that I got and I realized there are some errors in the log that I would like to avoid. There are multiple php files included in master file and each of them has a same constant defined. Which of course is not correct since constant can only be defined once. ..