Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66705 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 218 invoked from network); 19 Mar 2013 17:28:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2013 17:28:48 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.172 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.210.172 mail-ia0-f172.google.com Received: from [209.85.210.172] ([209.85.210.172:33475] helo=mail-ia0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 44/27-58539-F40A8415 for ; Tue, 19 Mar 2013 12:28:47 -0500 Received: by mail-ia0-f172.google.com with SMTP id l29so622343iag.17 for ; Tue, 19 Mar 2013 10:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=T3YY29PV/dJeI4+ISirnAE9i1sNJ424uPSs5OYC0yxY=; b=lWhw8DM5XeO0NuhJ7FHhhE54fLDEnGd9Z/8IxVxwfkU6ggpMxXi+H8rp4xRaK0tPRp /FhnRlVDjNi3SEpW1tjQmdjhuPY1nJEa6VP/yFcKUGQotkCsOzsDAvOy0MR1l96w69Wk L4Ld/ZDQZMbypho27FaZQ7VzKHo+v6rov5cIk22VjrbPgHJJsRBDtIuzcAyNpzToY6PP ok6c+TB2L/9SIeypAA48jujZkiRbdQRvdkoVDY3g7ISMkTPQfPBRQMIYuhcsUliZ+x7G v1dk4wzr2paa9zc4i0Eig+wWgoObCa/gEH60lE2mKCCAbdc8/Hx+9rSLLifD/w+iz3By ahlQ== MIME-Version: 1.0 X-Received: by 10.50.217.230 with SMTP id pb6mr2540653igc.43.1363714125275; Tue, 19 Mar 2013 10:28:45 -0700 (PDT) Received: by 10.50.114.137 with HTTP; Tue, 19 Mar 2013 10:28:45 -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 18:28:45 +0100 Message-ID: To: Daniele Orlando Cc: PHP Development , Pierre du Plessis , Bruno CHALOPIN , =?UTF-8?Q?Mat=C4=ABss_Roberts_Treinis?= Content-Type: multipart/alternative; boundary=14dae93411e70378e904d84a7012 Subject: Re: [PHP-DEV] __invokeStatic() method From: tyra3l@gmail.com (Ferenc Kovacs) --14dae93411e70378e904d84a7012 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Mar 19, 2013 at 5:35 PM, Daniele Orlando wrote= : > It is clear to me that there are valid reasons to say yes to this proposa= l, > 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 exampl= e. > > 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? > > pls don't top post on this list. about the idea: I think that it would be a really major change and doing that for the sake of a feature which only a small percentage of the userbase would ever use seems to be a bad idea. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --14dae93411e70378e904d84a7012--