Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85032 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82511 invoked from network); 16 Mar 2015 11:49:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2015 11:49:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=pajousek@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pajousek@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.176 as permitted sender) X-PHP-List-Original-Sender: pajousek@gmail.com X-Host-Fingerprint: 209.85.216.176 mail-qc0-f176.google.com Received: from [209.85.216.176] ([209.85.216.176:34581] helo=mail-qc0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FB/B2-03331-B53C6055 for ; Mon, 16 Mar 2015 06:49:48 -0500 Received: by qcaz10 with SMTP id z10so40586180qca.1 for ; Mon, 16 Mar 2015 04:49:45 -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=SHENKqR0dV+6puzEq7n/7jQyzf0GULdyZSZJlXSxS7I=; b=MzUT40s0XQjH4pe0fJmL614xOQvzDfXT5EvQAgyuH+hjZcfXgoPJBvNkP+Oo0zyyrz YaH55GTRZuNMuKGVOyPA8LnWn++Rr+5Idn2IENTh9b08TapUX2LCfT/RKloSnYhIvnKT 7LjqQ/MdavvtqjhMjgNdkUBeKbVqK5gQzWNQtQsVxe4SZi77GQ/6x27uGfav0KSUQNfT bg7kWOrITL3sK38C9UJMFWVTTiHGVk/Kzum9UPON3YJliTYkEN6Txwz9SiKj+euRT3Qm NDW6t0JHlEZFlzA02dxd+zlIO1lVsVzhh6aGP23fgS1IZo1hbG4Ai0YEwfKO2uKiNByl l1Ag== MIME-Version: 1.0 X-Received: by 10.140.237.14 with SMTP id i14mr25906049qhc.0.1426506585042; Mon, 16 Mar 2015 04:49:45 -0700 (PDT) Received: by 10.96.160.99 with HTTP; Mon, 16 Mar 2015 04:49:44 -0700 (PDT) In-Reply-To: References: <55066F07.80308@birkholz.biz> <5506794B.8090008@birkholz.biz> Date: Mon, 16 Mar 2015 12:49:44 +0100 Message-ID: To: Derick Rethans Cc: Yasuo Ohgaki , 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?=) >> >> This RFC will have serious consequence. We made mistake with >> "safe_mode". The main reason it failed is "it did not force caller to >> have responsibility to make it work as it should". This RFC does the >> same for how declare(strict_types=3D1) works. >> >> Aren't we learned from "safe_mode" lessons? > > I am not sure why you mention "safe_mode" as this has absolutely nothing > to do with scalar type hints. Not feature wise, not implementation wise. > > safe_mode, first of all, was a global INI setting. The developer > couldn't turn it off easily. That was probably at least 80% of the pain. > The second part was the name, as it indicated that it made your scripts > safe: It didn't. > > STHv5 does not suffer from either issue =E2=80=94 developers can pick and= choose > the best solution for *them* (give them some credit, most developers are > actually smart!). Library authors always get the right type if they type > hint, which is *their* main pain point. And the type names have always > already been used for casts anyway, and don't include "safe" in their > name. > > cheers, Hello, it's similiar to the safe_mode though. Sure, it's not as bad as INI setting, but the "intent" is the same - a switch changing how code behaves. When I talked about the Dual Mode with some friends who are userland PHP devs (either current or former, because they switched to other stuff), none of them called the Dual Mode a great idea. The responses I got were mostly along the lines of "wow, this seems really weird" to "WTF are those developers smoking". Everyone of them (sure, ~10 people isn't really representative number) said that they think PHP needs STH, but not this Dual Mode stuff. Seriously, think about it for a while - when some setting that changes how code behaves was a good idea? (IMHO never.) Regards Pavel Kouril