what is a Persistent Constant?
| From: | fabwash | Date: | Wed, 19 Jun 2002 16:05:04 +0000 |
| Subject: | what is a Persistent Constant? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-85376@lists.php.net to get a copy of this message | ||
Hello,
when you define a constant you can use two things that are not very clear to me. Can someone
explain?
1) CONST_PERSISTENT. How can a constant be persistent? The documentation says that the constant is
not "forgotten" after the process stops. Well if the process stops, where is the constant
stored? I couldn't find any place where the constant would be written to a file or some
location.
Then when then module is started again, all programs I have looked at register those same constants
again, so what is the point of making them persistent? Something is not getting into my small brain,
there.
2) REGISTER_MAIN_.. Those are supposed to remain in the symbol table. The only symbol table I see
is the Zend constant symbol table. So if the process ends, then they're lost, and that's
fine with me. But if a module registers a constant as MAIN, then gets unloaded, the constants stay,
available for other modules I guess.
So I understand REGISTER_MAIN (I think), although I don't really see the point, but i'm
totally not clear about CONST_PERSISTENT.
Anyone can explain?
Thanks!
Fab.