Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82307 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10673 invoked from network); 9 Feb 2015 18:41:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2015 18:41:25 -0000 Authentication-Results: pb1.pair.com header.from=pjsturgeon@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pjsturgeon@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.45 as permitted sender) X-PHP-List-Original-Sender: pjsturgeon@gmail.com X-Host-Fingerprint: 209.85.215.45 mail-la0-f45.google.com Received: from [209.85.215.45] ([209.85.215.45:38941] helo=mail-la0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/93-25034-55FF8D45 for ; Mon, 09 Feb 2015 13:41:25 -0500 Received: by labgq15 with SMTP id gq15so15365290lab.6 for ; Mon, 09 Feb 2015 10:41:21 -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:content-transfer-encoding; bh=QUNhhHQq4mDYs8kNnSTz8X4ObJCfAf6pQLXyZYwg7kg=; b=Xt8sovQklEQf0hzCZC2Y3IdoRyEK0aZBBm8ewHvNa1UNItltM7GzrZn8SqYQkyAEJ7 /Divw0AELuEaeIlWBIiwWTirf3kk5G629NIytQRMz14WBn56752wvTDoi/sh6NJo0EYC OKA0/YP7RxuUzn6SiToFjxXR2h3j3O+HPXRigWKnnd47GYyGPaSe7mc4rFh91V3fGYX4 2LjmAeh2mbCgLQAG6+gqmmtNesH3bOycCFD0IzJyglMzR5RnL3E8fALGJEMuEg16iskX dgCyv9Xl6IEHTaTL0z4Ox9sLvJmT5U3kHblWYkqb65dc/xrAJwhHWldgPCX9wkBWH5S0 5hgg== MIME-Version: 1.0 X-Received: by 10.112.162.226 with SMTP id yd2mr19420182lbb.1.1423507281137; Mon, 09 Feb 2015 10:41:21 -0800 (PST) Received: by 10.114.69.242 with HTTP; Mon, 9 Feb 2015 10:41:20 -0800 (PST) In-Reply-To: References: <8703B53E-2C4A-4AC6-95C4-D4F19C6D5221@ajf.me> <41EBB3A7-4AFC-4A73-B9AA-CD7129ACF9F0@strojny.net> <54D5FB10.1040100@beccati.com> Date: Mon, 9 Feb 2015 13:41:20 -0500 Message-ID: To: Lars Strojny Cc: Matteo Beccati , Andrea Faulds , PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints From: pjsturgeon@gmail.com (Philip Sturgeon) On Mon, Feb 9, 2015 at 1:22 PM, Lars Strojny wrote: > Hi Matteo, > > sorry for the late response. > >> On 07 Feb 2015, at 12:46, Matteo Beccati wrote: >> >> Maybe it's just me, but I didn't quite understand the point you are maki= ng here. Are you saying that declares are more or less like ini settings? > > Yes, exactly that. The new declare()-statement will fundamentally change = how the engine behaves and one will have two learn more or less two flavors= of PHP. Even worse I am forced to use the PHP flavor the person picked who= changed the declare() statement last. > > cu, > Lars This is strange for me to understand but I do see it come up a lot. "if you have foo(string $name), you expect strict type... if you want weak type, foo($name). All code will work as is today, no BC breaks." No. If I have foo(string $name), I expect a string. I don't care if its strong or weak, I just want a string. The weak or strong bit is up to the user, which is why they're the ones holding the switch. While I understand the wish to preach best practices to the PHP community in general - because heck knows some people need it - this is more of an entry for phptherightway.com than the job of every single library author to try and force the community ot use strict typing one library at a time. The function author doesn't need to care if its strong or weak. They just need to care that they have the right type. And they will, every time. Using foo($name) will give me the wrong types, so no thanks on that :)