Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106196 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 56989 invoked from network); 9 Jul 2019 12:52:37 -0000 Received: from unknown (HELO mail-io1-f51.google.com) (209.85.166.51) by pb1.pair.com with SMTP; 9 Jul 2019 12:52:37 -0000 Received: by mail-io1-f51.google.com with SMTP id s7so41885046iob.11 for ; Tue, 09 Jul 2019 03:12:14 -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 :cc; bh=WzjH40QA57qB6vw2kaX0ut2HJb2TWarW3iOJxNSRAKg=; b=MqV60krZVgBfX3Fo1yrkAxDQemuHE940goA+QFN/gJYUCF5a51LMQARVxfXTjuyW1v 0OnuuvIrzG8FxeS88xAvG0TDRdTLH4+BznWktKzbfgLOU9iCWHD/VSFbf+eDDfXxA4VF drWmcaihIMUUiG0atT65DIn0/tqSEIeVym6eGBLXbhaI06t1MMQyf+LTLsYkFnpjge/C OxAno1fbkhCBHJVfOI3n5huWP6ySfJJwTef0EmiU7qQakXM5z+L1Pl1VmCQKc3bEuvhB IZd3kLKT7njBKn84Y4/sBNeLrDCmMJzNkLBqsEvtBUFJbU2Y5G7NNX8O3iBVKeroHjyO i3Nw== 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:cc; bh=WzjH40QA57qB6vw2kaX0ut2HJb2TWarW3iOJxNSRAKg=; b=kk2YQfPHtcDzGfneYKflFekxFTfKyErL8Prw+E6vfTTQHeihdY8/n2bV+v+EpYZAVL JiWZTxgXbwjUv5vP+8cnuTD8htRe/k3gZLUJtWt/njUGQAxULasN/yj6BiYdy7+vTnJ3 Fh1E7uxElK0qHTO57cV7xT78rPFAunphD/atUmoTdUtLPg7GO9w8FS3Zcel4JeLNC1tA 8ayMidXC4ftcdOv3kfos2ldWsyTukft52waQuNXAFBvSx//FepHoSUEcoL9X3pxklQVq 1FyCOTwMOyX8ORqTYFQKhv0BoPg5Asg48AhVW7HQqGLGxwo4U2th4PN7N319PuqRbdKV 8mRA== X-Gm-Message-State: APjAAAUCGlIt+Ti1OTqP+n7btpXVLwwCqsxspzAHq6QNHdiJChANKTg2 ZjVp5/tdCuYHfxl0fcQPcVX/2t+x50blj6U/xYNG8g== X-Google-Smtp-Source: APXvYqwWPOrzMzOw9XWD6y+SJI2tVY9o95C14mhpK15z10/kwEeeMq6nh1+XuIn+NKFssjJO3sLjqjMfV546BUX+PMI= X-Received: by 2002:a05:6638:81:: with SMTP id v1mr25975983jao.72.1562667133997; Tue, 09 Jul 2019 03:12:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 9 Jul 2019 12:12:00 +0200 Message-ID: To: Christian Schneider Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000006c97f0058d3ccb71" Subject: Re: [PHP-DEV] [VOTE] Strict operators directive From: ocramius@gmail.com (Marco Pivetta) --0000000000006c97f0058d3ccb71 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jul 9, 2019, 12:06 Christian Schneider wrote: > Am 09.07.2019 um 11:30 schrieb Marco Pivetta : > > I wasn't sure about the full implications of this, but after some > thought, > > the worst that can happen is excessive strictness, requiring to drop a > > single declaration on top of a file =F0=9F=91=8D > > When you drop the declaration on top of the file the semantics of your > operators suddenly change, e.g. > "42" < "7" > changes from true to false and you get subtle bugs. > > And if you try to read other people's code (or even try to copy/paste it) > then make sure you keep in mind which mode they are programming in. > > - Chris > > > Hi Chris, That is already true for `strict_types`: my only worry with this directive so far is hitting edge cases that I didn't think of yet (requiring disabling it selectively). Doing that is pretty harmless if combined with testing and static analysis (which are an unavoidable assumption). Another way to restrict this RFC further is to allow this directive only when `strict_types` is already enabled, reducing the possible permutations of language behaviour. --0000000000006c97f0058d3ccb71--