Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80073 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89150 invoked from network); 2 Jan 2015 00:15:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jan 2015 00:15:16 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.171 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.214.171 mail-ob0-f171.google.com Received: from [209.85.214.171] ([209.85.214.171:35409] helo=mail-ob0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/01-18015-413E5A45 for ; Thu, 01 Jan 2015 19:15:16 -0500 Received: by mail-ob0-f171.google.com with SMTP id uz6so51869216obc.2 for ; Thu, 01 Jan 2015 16:15:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=DMJGuUZ5k3sl/Vl6h2WLzHTqYG0wAt85wFQcZSTyNLo=; b=uRUleoslleWg0VYdOj1BSGgnTRWHMYLmq9Di4ry13iSuwjoC6vHrI2x9V67+4GZs4R gyQTYyIeVb70qLED5aBJ+qiMLWkOarKldNAZpIGE66yPGzGeF5kT7fFG7wt2blWGJkWo Ukff4u3Rbcknq8RF0jn0iH5v91NY9H89d/MixCqmgJXL4/2BrW8nxbOAfTwgmospPYRe QBA9JSuGAWjv37k99mjeJXXQFRML52C+T/ajGp/KgZ0YEPvzSj7d59inG9HX0Sf3mAkp SrUSBflKfgT0pCJC1h3iUHl2gdNOpIU5xyRyCsdTPuttRAjVswMsRl9dsbTcGwDTVzd4 Wv4g== X-Received: by 10.182.120.10 with SMTP id ky10mr43290847obb.68.1420157713863; Thu, 01 Jan 2015 16:15:13 -0800 (PST) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id ve6sm15727426obb.2.2015.01.01.16.15.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jan 2015 16:15:13 -0800 (PST) Message-ID: <54A5E309.4050109@gmail.com> Date: Thu, 01 Jan 2015 16:15:05 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Andrea Faulds CC: PHP Internals References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> <54A466CB.9020400@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Yeah, it’s a problem. I think some breakage here is inevitable, > unfortunately. Some of the classes with these names are stand-ins for > scalar type hints, so that code can “just” migrate to using actual > hints. But this doesn’t apply to all of them. Breaking ZF2 and all software built on it is not "some breakage", it's a serious issue which would produce a big barrier for PHP 7 migration. And looks like there are more frameworks that do the same. This would be a barrier to PHP 7 adoption, and note that is even for people that couldn't care less for scalar typing. We'd find ourselves in python 3 situation - where people would be glad to upgrade but they use library X and it doesn't work and they have no idea how to fix it and they keep all their development on the old version and the new one never catches on. It'd be a shame if we spend all this effort on PHP 7 and get no adoption since people can't run their existing code on it. > We could choose to simply not prohibit them as class names, but that > creates a weird inconsistency where you can make ‘class Integer’ yet > ‘function foo(Integer $a)’ hints against the integer type, not your > class. Type hints are very widely used, so I doubt this would help > anyone, and we’d still be breaking existing code type hinting against > such classes. I'd rather make the hints case sensitive. In fact, of two BC breakages making classes case sensitive may be the lesser one (I'm not a big fan of either but at least the modern frameworks would probably all work and if some code does not it's possible to auto-fix it). > There’s not much we can do really. I suppose there is one positive > outcome, in that hopefully when broken code is updated to work, it > might have more descriptive class names. :) The issue here is that people that now use ZF2 or other framework like that won't rewrite it. They would just stay on PHP 5. -- Stas Malyshev smalyshev@gmail.com