Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85039 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94660 invoked from network); 16 Mar 2015 12:17:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2015 12:17:03 -0000 Authentication-Results: pb1.pair.com header.from=pajousek@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pajousek@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.44 as permitted sender) X-PHP-List-Original-Sender: pajousek@gmail.com X-Host-Fingerprint: 209.85.192.44 mail-qg0-f44.google.com Received: from [209.85.192.44] ([209.85.192.44:36659] helo=mail-qg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/25-03331-EB9C6055 for ; Mon, 16 Mar 2015 07:17:02 -0500 Received: by qgg60 with SMTP id 60so37595316qgg.3 for ; Mon, 16 Mar 2015 05:16:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=rGfNYJ1mds1yZyj+7ms7xRggyPTMyZpCT5/r9iJozBA=; b=ypdFwJXofViWCnVuEqrAH/TevcsPCGJzIuY8Hipgjzf6WOjM36BbG7Jri+IshITt9C OR21e9gDXZyY4RkkW8HGXHCkGPqJsKN32kFmB/tPTfdTYzokNQ4xrJA7fdBP63e4pISK SdsPAn4Z/6Sfa9BrUpuKwNdFU1kqulS+9uyvSC7sioJqdim5sH+trexokz3Nfjow0mjO vHDVlVO7Q7tqYYqxcjOlvEJZdExi0M9t39f2cciKfiP7WUbYrHQwPPIyekO/nNISfMmA +nKYeT61mNgKw2MyYMBuq29sNMB7rIF/VsOr/GIrpyniM0OTR/5DZ+i+y7o9RsXUrd9w TmWQ== MIME-Version: 1.0 X-Received: by 10.140.237.14 with SMTP id i14mr26057274qhc.0.1426508219893; Mon, 16 Mar 2015 05:16:59 -0700 (PDT) Received: by 10.96.160.99 with HTTP; Mon, 16 Mar 2015 05:16:59 -0700 (PDT) In-Reply-To: References: <55066F07.80308@birkholz.biz> <5506794B.8090008@birkholz.biz> Date: Mon, 16 Mar 2015 13:16:59 +0100 Message-ID: To: Dan Ackroyd Cc: Derick Rethans , Pierre Joye , PHP internals , Dennis Birkholz Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] About declare(strict_types = 1) From: pajousek@gmail.com (=?UTF-8?Q?Pavel_Kou=C5=99il?=) On Mon, Mar 16, 2015 at 1:04 PM, Dan Ackroyd wrote= : > On 16 March 2015 at 11:49, Pavel Kou=C5=99il wrote: >>>> >> >> Seriously, think about it for a while - when some setting that changes >> how code behaves was a good idea? > > > The problem is that there are two irreconcilable camps - some people > want weak STHs, other people want strict STHs. > > This RFC gives both camps what they want, at the cost of having the dual = mode. > > I personally would prefer a single mode, with strict STHs but I can > see that would piss off the other camp. And so to me, this RFC even > with the ickiness of the setting, is an an acceptable cost to giving > both sides what they want. Oh, and people who don't want to use scalar > type hints at all, can still continue to not use scalar type hints, > and their code will continue to keep working. > > Anyone who is voting no, isn't doing so because they are missing out > on a feature, they're doing it to block other people from getting what > they want in PHP, which is just a terrible way to vote. > > And if the strict camp are wrong and strict scalars are just not used > by a large proportion of the PHP community, it would be trivial to > remove support for the strict mode in a future version of PHP, as all > code that runs in strict mode, will automatically work in weak mode. > > cheers > Dan I can't speak for anyone who voted, but personally, if I could vote, I would voted "no" - not because "I don't want to block people from getting what they want", but because I sincerely think that having ANY setting that changes code's behavior is bad in the long run (and that removing the feature might not be really easy, once people realize that the feature is really bad, as people realized with safe_mode and register_globals after few years). I work on multiple projects for multiple clients - some have great code base, some have a bad one. Different typing contexts in different projects isn't going to help anything at all - it will only bring a mental overhead. It's really a shame the other way around wasn't put to vote - to add weak types, and if there's still enough momentum for "strict"* types, add them with the Dual Mode (although I would love to see PHP without Dual Mode completly). *) I also hate the name "strict" types, because this behavior is called "strongly typed" in every other language I stumbled upon; why does PHP have to be a special snowflake? But it's just an aesthetic thing, so it doesn't matter THAT much. PS: Also, I personally don't have a preference between strict or weak typing. I wished from the first moment the Dual Mode was RFC'd that just ONE ruleset would be chosen, and people would adapt to it. (Given the weak nature of PHP, the weak types probably fit more, but I personally could lived with either of those - just not at the same time.) Regards Pavel Kouril