> So finally to my question. Is it the intention of TSRMc. to allow
> ts_allocate_id() to be called at any time or is there an unwritten rule
> that it
> should only ever called during php startup ? If its the former then I
I think it gets called only on startup. I also think it was the intent,
though there is no safeguard as far as I can see against calling it in
run-time, but no module does it and it doesn't make sense to do it in
other place than startup.
> I myself see no reason why extension writers should be restricted from
> calling ts_allocate_id() outside PHP startup so believe the code needs
Well, the reason is that if you want to use TSRM globals, you have to
allocate ID before you do basically anything with them. Startup is a
good place for that. If you don't need globals, then you should not call
it at all. The situation where in the mid-run you suddenly remember you
need globals seems quite unrealistic to me. Of course, if you can
describe scenario when you would really need it in mid-run or it would
make sense to allocate ID in mid-run, then I guess this should be fixed
or at least safeguarded.
--
Stanislav Malyshev, Zend Products Engineer
stas@zend.com http://www.zend.com/