Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36773 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5970 invoked from network); 3 Apr 2008 02:27:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Apr 2008 02:27:28 -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:60746] helo=mail3.panix.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/69-17876-F8044F74 for ; Wed, 02 Apr 2008 21:27:28 -0500 Received: from panix3.panix.com (panix3.panix.com [166.84.1.3]) by mail3.panix.com (Postfix) with ESMTP id 64DB313A853 for ; Wed, 2 Apr 2008 22:27:25 -0400 (EDT) Received: (from analysis@localhost) by panix3.panix.com (8.11.6p3/8.8.8/PanixN1.1) id m332RP522552 for internals@lists.php.net; Wed, 2 Apr 2008 22:27:25 -0400 (EDT) Date: Wed, 2 Apr 2008 22:27:25 -0400 To: PHP Internals List Message-ID: <20080403022725.GA15662@panix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.10i Subject: overloading questions From: danielc@analysisandsolutions.com (Daniel Convissor) 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