I have been experimenting with defining functions as constants.
Below is what I am using to test "Function Constants":

<pre>
<?
define(LOGIN,"user");
define(PASS,"pass");
define(DB,"mysql");

define(DBLOGIN,dblogin(LOGIN,PASS,DB));

This is simply not allowed.

see:
  http://php.net/define

Can you elaborate on what is not allowed?
Are you saying defining function constants are not allowed or
are you saying redefining constants are not allowed?

I believe the answer is that both concepts are not allowed. Constants, by their very definition, cannot be redefined (except for magic constants, which is a different thing). Also, constants must be set as scalar values. PHP doesn't support function-like macros as you might have seen in the C preprocessor.


This is all in the PHP manual, under define() and constants.

Larry

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to