Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66697 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33733 invoked from network); 19 Mar 2013 08:13:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2013 08:13:15 -0000 Authentication-Results: pb1.pair.com header.from=php@bof.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=brianofish@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.50 as permitted sender) X-PHP-List-Original-Sender: brianofish@gmail.com X-Host-Fingerprint: 209.85.214.50 mail-bk0-f50.google.com Received: from [209.85.214.50] ([209.85.214.50:36229] helo=mail-bk0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/01-28284-A1E18415 for ; Tue, 19 Mar 2013 03:13:15 -0500 Received: by mail-bk0-f50.google.com with SMTP id jg9so86358bkc.9 for ; Tue, 19 Mar 2013 01:13:11 -0700 (PDT) X-Received: by 10.205.112.80 with SMTP id er16mr8448489bkc.12.1363680791686; Tue, 19 Mar 2013 01:13:11 -0700 (PDT) Received: from rofl.localnet (p5DCB2A27.dip.t-dialin.net. [93.203.42.39]) by mx.google.com with ESMTPS id ge12sm6173130bkc.19.2013.03.19.01.13.09 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Mar 2013 01:13:10 -0700 (PDT) To: internals@lists.php.net Cc: Bruno CHALOPIN Date: Tue, 19 Mar 2013 09:13:08 +0100 Message-ID: <1683535.aSTGThNVFk@rofl> User-Agent: KMail/4.10.1 (Linux/3.8.3-k10-bof; KDE/4.10.1; x86_64; ; ) In-Reply-To: <4F.50.28284.AA918415@pb1.pair.com> References: <4F.50.28284.AA918415@pb1.pair.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [PHP-DEV] __invokeStatic() method From: php@bof.de (Patrick Schaaf) On Tuesday 19 March 2013 02:54:19 Bruno CHALOPIN wrote: > Now I don't see why in the world a class and a function could share the same name. Well, for one, I might have code like this: class Foo { public static the_usual() { static $instance; if (!isset($instance)) $instance = new Foo(); return $instance; } } function Foo() { Foo::the_usual(); } ..... > Regarding conventions, a class name should begin with an uppercase character and a function a lowercase one. That' s a convention. That means that noone has to adhere to it. I don't. > I don't see any relevant use case where a class > and a function should share the same name. Don't let yourself be limited by your imagination. best regards Patrick