Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36813 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42661 invoked from network); 5 Apr 2008 13:27:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2008 13:27:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=danielc@analysisandsolutions.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danielc@analysisandsolutions.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain analysisandsolutions.com from 166.84.1.74 cause and error) X-PHP-List-Original-Sender: danielc@analysisandsolutions.com X-Host-Fingerprint: 166.84.1.74 mail3.panix.com Received: from [166.84.1.74] ([166.84.1.74:53672] helo=mail3.panix.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/D9-63123-84E77F74 for ; Sat, 05 Apr 2008 08:27:37 -0500 Received: from panix3.panix.com (panix3.panix.com [166.84.1.3]) by mail3.panix.com (Postfix) with ESMTP id 6F9C813A853 for ; Sat, 5 Apr 2008 09:27:33 -0400 (EDT) Received: (from analysis@localhost) by panix3.panix.com (8.11.6p3/8.8.8/PanixN1.1) id m35DRXw09840 for internals@lists.php.net; Sat, 5 Apr 2008 09:27:33 -0400 (EDT) Date: Sat, 5 Apr 2008 09:27:33 -0400 To: PHP Internals List Message-ID: <20080405132733.GA6531@panix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.10i Subject: Overloading Clarifications for Manual From: danielc@analysisandsolutions.com (Daniel Convissor) [Hmm... No answer in several days. Let's try this again with a different subject] I'm in the middle of clarifying the Overloading section of the manual, http://docs.php.net/manual/en/language.oop5.overloading.php. Some issues and questions have come up and your insights will be helpful, please. * The docs say "All overloading methods must be defined as public." At this point (in 5.2.1 and 5.3.0 snapshot) all visibility declarations are ignored: class bug_43924 { private function __call($name, $arguments) { echo $name . "\n"; } } $obj = new bug_43924; $obj->ObjectContext(); Is this an oversight in the engine? Are there plans to have the parser enforce the public declaration? * Along these lines, it would be an interesting new feature if one could declare any visibility for the overloading methods and have the engine observe them. This could allow people to use overloading for internal calls but skip them for external calls. * Some user comments say they find it helpful to have their __get() methods return by reference. Doing so is allowed at this point. Is this kosher? Will it remain so? * The value of $name in __call() is case sensitive, but in the newly added __callStatic() $name is lower case. Is this intentional? It seems the two methods should have the same behavior. * The new __callStatic() is neat. Thanks. Is there consideration of adding Static versions of the other overloading methods? Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409