Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83090 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79614 invoked from network); 18 Feb 2015 16:33:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2015 16:33:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.179 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.179 mail-qc0-f179.google.com Received: from [209.85.216.179] ([209.85.216.179:57761] helo=mail-qc0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F7/54-56339-5EEB4E45 for ; Wed, 18 Feb 2015 11:33:41 -0500 Received: by mail-qc0-f179.google.com with SMTP id r5so1709066qcx.10 for ; Wed, 18 Feb 2015 08:33:38 -0800 (PST) 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; bh=IWuoX434S3XjizQnBhf9ST7dQHcdZmq/43F383cqIvM=; b=Lc+107fwnsb7qG0sfZQQwWq/MSQinddrZI0xn2gOeyvAdPVb1jBKTe3BrZqsM0dVm3 1towkgFy8Sy7MZKCZyCw5tgWIrQN4fBWNzeqTeozkV2ksowRONxNicZXUBW3aJdwCijI oLAYKAgFvrbWfg5OsYANTrt67V0CPIqJO8ri5pPEp4i84x0XjaVtBvBmyH3umycyxsIA w5qjP8aw+wLeasOpgrAP4U2oBlyauJpR4SwrNHmy4kY1NXgsVIvAfPUQ/Sd+jHKFuCSC sCXdsAuplM1Lm0QqdX6LWepHIGsuvlOsnAK+lUvvpxOXd6Zz1M3gblEZXfkoq7iy+hiZ W49g== MIME-Version: 1.0 X-Received: by 10.140.95.179 with SMTP id i48mr1946338qge.4.1424277218895; Wed, 18 Feb 2015 08:33:38 -0800 (PST) Received: by 10.96.39.195 with HTTP; Wed, 18 Feb 2015 08:33:38 -0800 (PST) In-Reply-To: References: <54E3E27B.2010903@lerdorf.com> Date: Wed, 18 Feb 2015 08:33:38 -0800 Message-ID: To: Nikita Popov Cc: Rasmus Lerdorf , Sara Golemon , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Scalar Type Hints v0.4 From: pierre.php@gmail.com (Pierre Joye) On Tue, Feb 17, 2015 at 5:05 PM, Nikita Popov wrote: > On Wed, Feb 18, 2015 at 1:53 AM, Rasmus Lerdorf wrote: > >> On 02/17/2015 04:35 PM, Nikita Popov wrote: >> > I don't buy into Rasmus arguments about internal functions. They concern >> > one particular edge case (int->float coercion) and I doubt they have much >> > relevance if applied to codebases with pervasive use of typehints (where >> > you can be reasonably sure of the types of your variables). Even if, for >> > the sake of argument, we acknowledge the concern as valid we should be >> > discussing that particular case (int->float coercion) rather than >> dropping >> > the strict typing for internal functions altogether. >> >> int->float is actually secondary to "123"->int. And while they may be >> edge-cases there are enough of them that we would be pushing people >> towards casting by default which should be a last-resort thing, not the >> first thing you do. >> > > The inability to implicitly cast "123" to int is pretty much the KEY > distinction between weak and strict scalar typehints (those pesky > value-dependent type checks). If the strict typing mode doesn't offer this, > what's the point at all? > > This is exactly what I fear will happen with an arginfo based approach. If > even fundamental aspects like the "123" vs 123 (or true vs 1) distinction > are suppressed for internal functions, this isn't a strict typing mode, > it's just a weak typing mode with slightly different rules. I totally agree with you here, and with your next more verbose reply. I am astonished to see where this discussion simply redo what we discussed to death already and basically see no progress toward a compromise but a way to get weak typing in place. I do not see much value to argue in circle forever and will actually support what I consider as good once there is a RFC in place. Weak typing only won't be the one I would choose. I remain a fervent supporter of the previously proposed dual mode, which actually covers all we need. Yes, there are implementation details (I repeat: yes, I do consider most of the raised issues as implementation details), but generally it is the compromises and way I see as the way to go. Cheers, -- Pierre @pierrejoye | http://www.libgd.org