Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80076 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93552 invoked from network); 2 Jan 2015 00:26:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jan 2015 00:26:08 -0000 Authentication-Results: pb1.pair.com header.from=mails@thomasbley.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=mails@thomasbley.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain thomasbley.de from 85.13.137.24 cause and error) X-PHP-List-Original-Sender: mails@thomasbley.de X-Host-Fingerprint: 85.13.137.24 dd15934.kasserver.com Received: from [85.13.137.24] ([85.13.137.24:56910] helo=dd15934.kasserver.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/02-18015-D95E5A45 for ; Thu, 01 Jan 2015 19:26:08 -0500 Received: from dd15934.kasserver.com (dd0802.kasserver.com [85.13.143.1]) by dd15934.kasserver.com (Postfix) with ESMTPSA id AE5CE260997; Fri, 2 Jan 2015 01:26:02 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SenderIP: 95.90.235.1 User-Agent: ALL-INKL Webmail 2.11 In-Reply-To: <54A5E309.4050109@gmail.com> References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> <54A466CB.9020400@gmail.com> <54A5E309.4050109@gmail.com> To: ajf@ajf.me, smalyshev@gmail.com Cc: internals@lists.php.net Message-ID: <20150102002602.AE5CE260997@dd15934.kasserver.com> Date: Fri, 2 Jan 2015 01:26:02 +0100 (CET) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: mails@thomasbley.de ("Thomas Bley") ZF2 completely broke compatibility with ZF1 users, so I think this is a bad example. Regards Thomas Stanislav Malyshev wrote on 02.01.2015 01:15: > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >