Why can constants only be scalars?
| From: | Sara Golemon | Date: | Sat, 08 May 2004 04:16:11 +0000 |
| Subject: | Why can constants only be scalars? | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-9726@lists.php.net to get a copy of this message | ||
Long ago I was told constants could only be scalars, so I accepted it.
Certainly ZEND_FUNCTION(define) does the check to ensure it's a scalar, but
why?
For what I can tell a zend_constant is just a container for an ordinary zval
which is refcounted and all that fun stuff. I don't see any obvious reason
for this restriction, and my tests with those restrictions removed seem safe
enough so far... Can someone spell it out for me with little words?
-Sara