Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106071 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 53946 invoked from network); 26 Jun 2019 13:44:07 -0000 Received: from unknown (HELO mail-io1-f49.google.com) (209.85.166.49) by pb1.pair.com with SMTP; 26 Jun 2019 13:44:07 -0000 Received: by mail-io1-f49.google.com with SMTP id r185so4021672iod.6 for ; Wed, 26 Jun 2019 04:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=iGLpZ2M8TVxD7w6wvWrnHPLNZy67K80KwQCQK78Dzic=; b=C/c41CuDaPzu9U7/YXxbZrP8b6VQ7g2R9qXav1ja+8Au4Evc7/JInZgpcQN4XjN2PS DdHR9Kv/dLTGYZJEDRddFjlxYZ7QxG4/1XJr0P/lxiktRMiL+sl5pg1rAlgaUFlg9dXe skWbJKthw7LNoHPeiN0lplC+ct/YYFpiC6T9NDZNim6iXZv4sUMdntcrciicBmyxR063 X7tXGyPBBjXZyhnnXFVUjlFFxPF4o8f+ky3NXCNa4dIwNi5XX6PwiFNgsIdLDEoduHE2 3YHgGa62EZ33+HX1gOX5+OTJo6sP4ddp/LqjiI3kEtIFg0ijBAohLfHSAUJQpim0ogqD cCog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=iGLpZ2M8TVxD7w6wvWrnHPLNZy67K80KwQCQK78Dzic=; b=k6nLj7D2zNmiRDbFpolqYGxkcm3y5fQqYDPeJTMggcsWBZaYcGzUW1oGXtrSxo+3n6 bMqraH3bcbq++rZYk9XI4ssD7K+GorIEVydwaMSpqPMT1THYj064CuSucscA4SdfR4JT 14exnOSYMY6Xs5FMOkprDVdVUfMDozzUriyrjkP4U/busVTY6bRk7KzoCD/y+O6juyA6 /3rwctv+ISqiSsKQrRBBtwTrX5nOZyAN4RRcv5eFCqKz24B4KLaX2GwxBJt7OHSGX8Ty BWdsdnlVEQyMihV//EZRiIbaU93ilEl7bieYqunwU1h4jI9OHMtB2Bxa1Q5j0+CmJuGn BzYw== X-Gm-Message-State: APjAAAVZFGhmGtwqyRbcD018X2Mb9tY7/iMWipKXe14YstOzyoQi4irx tWnxZ/OYmW7geV7MD9DdulbtbZBCO8PabiyVp0+h2cnN8ro= X-Google-Smtp-Source: APXvYqwHHd/mVvsqtzCqoxAtT+SXi58BZlQ8zQ4xJjmiU3EVaRmG5+DKasD/5uwweygIchG/s781LMGAONptz8YSLc8= X-Received: by 2002:a5e:8e42:: with SMTP id r2mr3972879ioo.305.1561546829311; Wed, 26 Jun 2019 04:00:29 -0700 (PDT) MIME-Version: 1.0 References: <6D1026FF-ECF1-4604-91A8-D290D37CC238@cschneid.com> In-Reply-To: Date: Wed, 26 Jun 2019 12:00:18 +0100 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="0000000000000fb29a058c37f48d" Subject: Re: [PHP-DEV] [RFC] Strict operators directive From: rowan.collins@gmail.com (Rowan Collins) --0000000000000fb29a058c37f48d Content-Type: text/plain; charset="UTF-8" On Wed, 26 Jun 2019 at 10:36, Benjamin Morel wrote: > Oh, I see. You mean that only replacing some of the current results with > TypeErrors would be acceptable; returning a different value would not. > This makes a lot of sense, but once again prevents the language from slowly > moving towards something different (and better), leaving it stuck in its > legacy forever. > If we're talking about combining operator overloading and type juggling in the way that JS does it, I would definitely debate whether that's "better". It leads to the weird circular situation where to know what an operator means, you have to look at the types; but to know how the types will be interpreted, you need to know what the operator means. Perl is a notable contrast: the types of operands are deduced based on the operator, but there are different operators to force them to different types. So `23 < 4` and `"23" < "4"` are both numeric comparisons, so return false; but `23 lt 4` and `"23" lt "4"` do string comparisons, and return true. That way the user's intent is clear, but you don't have to manually cast values or remember how different combinations will be interpreted. > I'm starting to believe that a joint effort to fork PHP if the only way out > If what you want is a fork of PHP with stronger typing, then take a look at Hack https://hacklang.org/ Regards, -- Rowan Collins [IMSoP] --0000000000000fb29a058c37f48d--