Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84074 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66332 invoked from network); 28 Feb 2015 08:40:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Feb 2015 08:40:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=francois@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=francois@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@php.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:49201] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/11-59402-30F71F45 for ; Sat, 28 Feb 2015 03:40:36 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id EB8074B0150; Sat, 28 Feb 2015 09:40:06 +0100 (CET) Reply-To: To: "'Brian Moon'" , "'Benjamin Eberlei'" , "'Zeev Suraski'" Cc: "'PHP internals'" References: <54F0A9C1.6050904@moonspot.net> In-Reply-To: <54F0A9C1.6050904@moonspot.net> Date: Sat, 28 Feb 2015 09:40:25 +0100 Message-ID: <0bc701d05332$32fee460$98fcad20$@php.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHbEgvqZ08kgCvmYfG4mXODzCFejgJSRgVdAbuTZOWcz82Y4A== Content-Language: fr X-Antivirus: avast! (VPS 150227-0, 27/02/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] Coercive STH - some real world tests and updated RFC From: francois@php.net (=?utf-8?Q?Fran=C3=A7ois_Laupretre?=) > De : Brian Moon [mailto:brian@moonspot.net] > > I agree here with Benjamin. The thing I have wanted in user land for > years is to be able to build a user land function that worked the way > internal functions do in terms of type checking without having to = build > my own type checking system. Having internal functions convert null to = a > scalar and not having user land do the same creates an inconsistency. > For example, sometimes you want to wrap/extend an internal function = (you > see it a lot with json* to do encoding checking). I can't reliably = take > the same input to my user land wrapper that I can send to the internal > function. I would prefer to see the same rules apply to internal and > user land. It would be better, yes. Unfortunately, accepting or refusing null to = scalar in both is difficult. If we disable null to scalar, we = potentially generate a lot of deprecation messages for existing code = calling internal functions this way. If we enable null to scalar, we = create massive future inconsistencies now and in the future. An example = : Function foo(): string {} // OK because returns null and null accepted = as string. My opinion, but that's only mine, is that I would favor deprecating null = to scalar, even for internal functions. It would add deprecation = messages but we'd end up with a cleaner code. Regards Fran=C3=A7ois