Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85038 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92880 invoked from network); 16 Mar 2015 12:13:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2015 12:13:13 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:40554] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D3/D4-03331-8D8C6055 for ; Mon, 16 Mar 2015 07:13:13 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 51C5CE202F; Mon, 16 Mar 2015 12:13:08 +0000 (GMT) Date: Mon, 16 Mar 2015 12:13:08 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: =?UTF-8?Q?Pavel_Kou=C5=99il?= cc: Yasuo Ohgaki , Pierre Joye , PHP internals , Dennis Birkholz In-Reply-To: Message-ID: References: <55066F07.80308@birkholz.biz> <5506794B.8090008@birkholz.biz> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-159165494-1426507988=:4205" Subject: Re: [PHP-DEV] About declare(strict_types = 1) From: derick@php.net (Derick Rethans) --8323329-159165494-1426507988=:4205 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 16 Mar 2015, Pavel Kou=C5=99il wrote: > >> This RFC will have serious consequence. We made mistake with=20 > >> "safe_mode". The main reason it failed is "it did not force caller=20 > >> to have responsibility to make it work as it should". This RFC does=20 > >> 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=20 > > nothing to do with scalar type hints. Not feature wise, not=20 > > implementation wise. > > > > safe_mode, first of all, was a global INI setting. The developer=20 > > couldn't turn it off easily. That was probably at least 80% of the=20 > > pain. The second part was the name, as it indicated that it made=20 > > your scripts safe: It didn't. > > > > STHv5 does not suffer from either issue =E2=80=94 developers can pick a= nd=20 > > choose the best solution for *them* (give them some credit, most=20 > > developers are actually smart!). Library authors always get the=20 > > right type if they type hint, which is *their* main pain point. And=20 > > the type names have always already been used for casts anyway, and=20 > > don't include "safe" in their name. >=20 > it's similiar to the safe_mode though. Sure, it's not as bad as INI=20 > setting, but the "intent" is the same - a switch changing how code=20 > behaves. The intent is no where near the same. safe_mode is an evil monster from the depts of a lone sysadm that sees=20 "oh it's safe" - without a developer having a chance to do anything=20 about it. strict is an option mode that a developer that writes a specific PHP=20 file can opt into. Absolutely not even the same magnitude of evil. cheers, Derick --8323329-159165494-1426507988=:4205--