Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66706 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8443 invoked from network); 19 Mar 2013 18:58:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2013 18:58:46 -0000 Authentication-Results: pb1.pair.com header.from=pierre@pcservice.co.za; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre@pcservice.co.za; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain pcservice.co.za designates 67.18.66.20 as permitted sender) X-PHP-List-Original-Sender: pierre@pcservice.co.za X-Host-Fingerprint: 67.18.66.20 gateway02.websitewelcome.com Linux 2.6 Received: from [67.18.66.20] ([67.18.66.20:33163] helo=gateway02.websitewelcome.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/10-07534-465B8415 for ; Tue, 19 Mar 2013 13:58:45 -0500 Received: by gateway02.websitewelcome.com (Postfix, from userid 5007) id 4FE55AC75D9F3; Tue, 19 Mar 2013 13:58:37 -0500 (CDT) Received: from vinacomin.websitewelcome.com (vinacomin.websitewelcome.com [50.97.101.199]) by gateway02.websitewelcome.com (Postfix) with ESMTP id 375C5AC75D99C for ; Tue, 19 Mar 2013 13:58:37 -0500 (CDT) Received: from [209.85.216.43] (port=62178 helo=mail-qa0-f43.google.com) by vinacomin.websitewelcome.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.80) (envelope-from ) id 1UI1k9-0006oq-8d for internals@lists.php.net; Tue, 19 Mar 2013 13:58:41 -0500 Received: by mail-qa0-f43.google.com with SMTP id l8so137569qaq.9 for ; Tue, 19 Mar 2013 11:58:40 -0700 (PDT) X-Received: by 10.49.129.7 with SMTP id ns7mr3462005qeb.59.1363719520485; Tue, 19 Mar 2013 11:58:40 -0700 (PDT) MIME-Version: 1.0 Reply-To: pierre@pcservice.co.za Received: by 10.49.129.134 with HTTP; Tue, 19 Mar 2013 11:58:10 -0700 (PDT) In-Reply-To: References: <20.05.17382.B0318415@pb1.pair.com> <4F.50.28284.AA918415@pb1.pair.com> Date: Tue, 19 Mar 2013 20:58:10 +0200 Message-ID: To: Daniele Orlando Cc: PHP Development , Bruno CHALOPIN , =?UTF-8?Q?Mat=C4=ABss_Roberts_Treinis?= Content-Type: multipart/alternative; boundary=047d7b67880097906204d84bb1d5 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vinacomin.websitewelcome.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pcservice.co.za X-BWhitelist: no X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (mail-qa0-f43.google.com) [209.85.216.43]:62178 X-Source-Auth: pierre@pcservice.co.za X-Email-Count: 5 X-Source-Cap: cGNzZXJ2aWM7cGllcnJlO3ZpbmFjb21pbi53ZWJzaXRld2VsY29tZS5jb20= Subject: Re: [PHP-DEV] __invokeStatic() method From: pierre@pcservice.co.za (Pierre du Plessis) --047d7b67880097906204d84bb1d5 Content-Type: text/plain; charset=ISO-8859-1 > It is clear to me that there are valid reasons to say yes to this proposal, > but there are a lot to say no too. > Even if it could be interesting in theory, due to of how PHP handles > collisions between classes and functions names (no check at all), > implementing a callable class could break existing code. > > At the moment a class and a function with the same name can coexist, > but implementing a callable class would mess this state of affairs. > With the adoption of the namespaces, I think that this collisions could > became > so rare to not exist, but of course we cannot ignore pre existing > situations. > > As suggested by Patrick Schaaf, a workaround is to implement a function, > with > the same name of the class, that behaves like a wrapper for a method call. > It is a good point, but has the negative side that it must be implemented > for every > class who follow this pattern. It is not usable in a framework for example. > > It seams that to handle consistently a callable class is to modify PHP > to treat functions/classes names case sensitive and to trigger an > E_WARNING (or similar) in case of collision. > In this way new code could take advantage of the new syntax and old code > could simply suppress the warning. > > What do you think? This change might be disastrous in some applications, and I don't think it will be worth it just for the sake of some syntactic sugar. And still this change won't even make a difference if you have a class and function with the same name that E.G uses all lowercase. --047d7b67880097906204d84bb1d5--