Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_builtin_functions.c
| From: | Zeev Suraski | Date: | Fri, 22 Aug 2003 13:20:59 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_builtin_functions.c | ||
| References: | 1 2 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-1659@lists.php.net to get a copy of this message | ||
At 16:14 22/08/2003, Ilia Alshanetsky wrote:
On August 22, 2003 08:59 am, Zeev Suraski wrote: Why is it necessary? And anyway, hardcoded numbers like this aren't a good idea... As it now stands user defined constants do not have a module_number, which means that any operation that tries use that field will be making an operation on an undefined field.But no operations should be running on that field, except on module-unloads, which should happen after user-defined constants are already gone. If you got to a situation where this field is being read undefined, then there's a bug somewhere else, most probably.
The 2147483647 is a 'safe' number that will not conflict with any module_numbers as set by regular modules and allow identification of user defined constants via module_number. That said it would be better to define this number inside zend_constants.h, which I will do unless there are any other problems (?).You probably want LONG_MAX or something like that..? Anyway, this whole thing shouldn't be necessary - if you found that it is, then please let me know where... Zeev