Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80590 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75308 invoked from network); 15 Jan 2015 20:43:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2015 20:43:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.218.50 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.218.50 mail-oi0-f50.google.com Received: from [209.85.218.50] ([209.85.218.50:45729] helo=mail-oi0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/92-61348-E5628B45 for ; Thu, 15 Jan 2015 15:43:11 -0500 Received: by mail-oi0-f50.google.com with SMTP id x69so14304946oia.9 for ; Thu, 15 Jan 2015 12:43:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=02gvvdSU+Zy0vjZ5Jc8CLX+5Qpy6p1NFyZFnWy64Glc=; b=BXAQ5PuAxwvqGSccwSoXw9rJiXJH9yI7pfdpM5ZmNmH7dp/UhlW0H7MAmE9fSnT2BK rbhW5jLxfZeAWmvKy44Mhxjn00iMHyYxb2VbQ0lcFUZdDE1agyuQi6Ariaez8/9ZoyqI B1azRlOiUG0Ptea6Pq75DkYjm0r/HJgMDtfOw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=02gvvdSU+Zy0vjZ5Jc8CLX+5Qpy6p1NFyZFnWy64Glc=; b=TH+C9BKbMfjhMi7Or8pPyMnDgTmz6TRS+XGj1D32HegcfE0qrK91/oWea2MeVbo4pF 5SM3JTr7moWJxwTTeYjeVx/hHiqnGUnmZMW4UgQG3RD6VeyVUXxwiYJagYOYLyv5OVFz YTAxYOkc+fcfeIPopwWRVLlszxOw+OrTcdqgkzGnQ5CgkzZKqKmlmenAcSP7a/8YvYlK Fccuode9U7ngSJocq8odOjb+RWfyBTz81+YA3LKxPtCn1eytppssM8Y//oO9tPmL+xwT Iz9Td42s+Y2X0wCqrjBxX5qisWOz1TltMEwaCrHjkpD1XqymdY8ttlV8yvOopkL4Lyzp 2kpg== X-Gm-Message-State: ALoCoQlDM4VIYoFAKfSTHA9OxCQWmoSKm4RVHCAyeBZqmm2QSwv/x4/D0bJiP5FQcT/vJ2s3aoX4 MIME-Version: 1.0 X-Received: by 10.202.74.135 with SMTP id x129mr6759636oia.58.1421354587616; Thu, 15 Jan 2015 12:43:07 -0800 (PST) Received: by 10.202.214.146 with HTTP; Thu, 15 Jan 2015 12:43:07 -0800 (PST) In-Reply-To: <8BABA306-12CE-4568-98F3-419A1557F61B@ajf.me> References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> <4E2073DE-0951-498C-97BB-DDAC094F11FA@ajf.me> <9a033dd1f223f854e760924d118ab812@mail.gmail.com> <2ae0164cb9b9bf1c974d7a3c60af0466@mail.gmail.com> <6105ea99002e634373c09685310e26a6@mail.gmail.com> <8BABA306-12CE-4568-98F3-419A1557F61B@ajf.me> Date: Thu, 15 Jan 2015 22:43:07 +0200 Message-ID: To: Andrea Faulds Cc: marcio3w@gmail.com, "S.A.N" , Mike Willbanks , Zeev Suraski , Richard Quadling , Leigh , PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: narf@devilix.net (Andrey Andreev) Hi Andrea, On Thu, Jan 15, 2015 at 9:52 PM, Andrea Faulds wrote: > > Sure, weak typing is much poorer than strict typing for error checking. D= oes that mean the user should be prevented from having the choice? > > Are you simply opposed to the idea of weak types in general? > I am opposed to the idea of having *only* weak types, or that there's one way to rule them all. And you might argue that this RFC provides both, but it obviously only appears to do so in practice. > > Both co-existing doesn=E2=80=99t solve anything, if anything it makes it = worse. > > People who like weak typing don=E2=80=99t want to have to use APIs with s= trict type hints. If you=E2=80=99re like Zeev and believe it is fundamental= ly at odds with PHP, you=E2=80=99ll especially dislike it. > > People who like strict typing don=E2=80=99t want to have to use APIs with= weak type hints. > ... and this is where we fundamentally disagree. I like both, I want to use both for different use cases and I don't see what is it that will be bad about co-existence. Any library author who wants strictness *will* force it on you, even if that means writing 3x times more code. > > I don=E2=80=99t care if PHP is concerned about it. I am concerned about t= he mess caused by having two or three different argument type checking mode= s being used within the same function. > And yes, I also want to use both weak and strict type-hints in the same function. :) >> On 15 Jan 2015, at 19:45, Marcio Almada wrote: >> >> Hi, >> >> I would like to call everyone's attention, specially people >> contributing directly to this RFC series, to what S.A.N just said: >> >> > Many developers PHP offers dual syntax: >> > >> > 1. Strict >> > function bar(int $num){} >> > >> > 2. Lax >> > function bar((int) $num){} >> > >> > Maybe it makes sense to put this option on the ballot if it passes a v= ote, >> > it will be possible to put an end to the discus? >> >> >> This idea has been **so recurrent** and yet systematically ignored by RF= C owners. Why? I think that we need to baby step and try to approve coerciv= e type declarations first and decide upon a possible stricter type check la= ter: >> >> How a bout a reboot of what ircmaxell@php.net already started in https:/= /wiki.php.net/rfc/parameter_type_casting_hints for v0.3? >> >> PS: Please, let's not fall into the mindset of "if v0.2 is not a good id= ea then v0.1 instantly becomes more acceptable", we still have time to try = some alternatives. I almost completely agree, especially with the postscript (but excluding the baby steps, although ... it's a good price to pay if we all end up happy). I believe the linked RFC was withdrawn because that's when Anthony Ferrara "rage" quit internals? My money would be on it being accepted and already running in the wild if that hadn't happened. There's no reason not to. Cheers, Andrey.