Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4100 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78424 invoked from network); 20 Aug 2003 03:10:23 -0000 Received: from unknown (HELO bgbest.net) (212.91.188.18) by pb1.pair.com with SMTP; 20 Aug 2003 03:10:23 -0000 Received: (qmail 20616 invoked from network); 20 Aug 2003 03:10:18 -0000 Received: from unknown (HELO damagegqsaogpp) (212.91.188.130) by dns.bgbest.net with SMTP; 20 Aug 2003 03:10:18 -0000 To: "PHP-DEV" Date: Wed, 20 Aug 2003 06:10:13 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Subject: __autocreate() function for non-existing variables From: vma1@abv.bg ("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 creates. This could be very useful in some cases. For example it could be used in a php library that creates a database object. When some function tries to use the database object, the __autocreate function will check if a global database object exists. If it does not exist the function will create the database object as global and in either case return a reference to the object. I am willing to implement this functionality, but I'd like to hear the opinion of the PHP developers first and especially of the Zend2 team because this functionality will modify the Zend2 engine. vesselin