Re: Re: [PHP-DEV] __autocreate() function for non-existing variables

2003-08-20 Thread Zeev Suraski
Try to use the language features that exist to implement your functionality. If you find that you cannot do it, chances are that you're trying to do something wrong, and not that the language is missing some core feature. Zeev At 12:00 20/08/2003, Vesselin Atanasov wrote: Hello. Sorry for dou

Re: Re: [PHP-DEV] __autocreate() function for non-existing variables

2003-08-20 Thread Vesselin Atanasov
Hello. Sorry for double posting but I forgot to CC it to the mailing list. Basically I need some special names to be available automatically without the need to create them via new() Some of them just like the database object will be singletons, but some need a different copy in every symbol table

Re: [PHP-DEV] __autocreate() function for non-existing variables

2003-08-20 Thread Zeev Suraski
I don't see need for this magic. You can implement this using a simple singleton pattern, if you need it. I don't think we want to add features that will condone the use of globals, a singleton class is a much better solution for that. Zeev At 06:10 20/08/2003, Vesselin Atanasov wrote: Hello

[PHP-DEV] __autocreate() function for non-existing variables

2003-08-19 Thread Vesselin Atanasov
Hello. I think that it would be useful to allow an __autocreate() function create non-existing variables just like __autoload is called for non-existing classes. The function will be called when an attempt is made to read a non-existent variable. It will return a reference to the new variable it cr