Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106198 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61029 invoked from network); 9 Jul 2019 13:02:21 -0000 Received: from unknown (HELO mail-ed1-f43.google.com) (209.85.208.43) by pb1.pair.com with SMTP; 9 Jul 2019 13:02:21 -0000 Received: by mail-ed1-f43.google.com with SMTP id k8so17213868edr.11 for ; Tue, 09 Jul 2019 03:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TGsI2+7nsUu4NgGqQD+78zZ09hvTur2ACZYI7NUzEj0=; b=A4M8ONctzF/BFtO+HWaIs1790Gi4waZUYgIFV+Hsupp5WmqBUq65iSQzr9piIu+2NI uUaHL/f01tNLHN1v/RgyoeVJ8lcRt6MLX+TdMj2d6H2tFy8Br0Ut0nrT5d3J1AOMzaow f+nfSkn5hIlQ2aAvkscl8Sa3CYiOXZ3kWcxKy93b92FM7XZsO1qDdAD4IxoZ5J/cj2LM C2N1XhIpw0mLrIKeiiq4qq6RQToPLbtVvMi9AuK3vEzHrVJYk1+U/64m1QUtOBjujqT+ P+Kjpfis1PA5NcFFi4lU3zS3UpKsh0LKwPgbOal/ufmVZJfRZGt9/BHJ2gD6MTzMDQmb AKnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TGsI2+7nsUu4NgGqQD+78zZ09hvTur2ACZYI7NUzEj0=; b=bVs0E6JyYOYKNkSizc7XSTIdvJalvNaTbT2jGXk0qigU1tGCfMvasHLiIRl24RV5oN Ru53qZC2KJxcNZkJHWc2eAEX9Ao80l+kB8XgEC/1dWqmN+hKy73JJg5VMnpeqIr6Pf75 Y7LGWWDmP/V2Hj6fadijjqJKTThKP9EpylPnZV+BRDKPBJggjO0E+kO34A7/NNEzbpLC mFWEDeTX6lZOA4aRh/6r2E0tV+H4BkVgxWkCggDFgnRgzKAUkxAK9zgea6cn9iZwKl9u GYGAS5GO7j893XDgHbvMd6VJgNBspFUpavUDoyCzZeM+xmgP4DsxbXCXRrcGBZZv+5wl jjwg== X-Gm-Message-State: APjAAAVm1XwIS3Yi8Z3MqFJx4+GLW3BffR14mhT5lWw+tVyzPaqElmIx cpZQhhKSYAubYUo7Xk4XpxE= X-Google-Smtp-Source: APXvYqxqp/EL4OA7ydQq9Zb4J5Es7dl7ZcCcaHfjhFFy2lee/670GVnIS2gdTaCmpYMmmqIuy2RRgA== X-Received: by 2002:a17:906:3f87:: with SMTP id b7mr20262025ejj.164.1562667718474; Tue, 09 Jul 2019 03:21:58 -0700 (PDT) Received: from [192.168.0.63] (84-75-30-51.dclient.hispeed.ch. [84.75.30.51]) by smtp.gmail.com with ESMTPSA id h15sm4201261edb.57.2019.07.09.03.21.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jul 2019 03:21:57 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: <88b65a46-f080-ae08-d89e-ee6c4299a19c@heigl.org> Date: Tue, 9 Jul 2019 12:21:56 +0200 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <6BE96F43-19D5-465E-B93F-0B3CC2E11F25@gmail.com> References: <88b65a46-f080-ae08-d89e-ee6c4299a19c@heigl.org> To: Andreas Heigl X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] [VOTE] Strict operators directive From: claude.pache@gmail.com (Claude Pache) > Le 9 juil. 2019 =C3=A0 12:09, Andreas Heigl a = =C3=A9crit : >=20 >=20 >=20 > Am 09.07.19 um 12:06 schrieb Christian Schneider: >> 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 >>=20 >> 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. >>=20 >> 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. >=20 > But that's the same for `declare(strict_types=3D1);` >=20 > Cheers >=20 > Andreas No, it=E2=80=99s not the same thing as declare(strict_types=3D1). With declare(strict_types=3D1), you just get additional TypeErrors. It = will not actually change the semantics of code that works in both = non-strict-types mode and strict-types mode. This is a useful feature = when refactoring legacy code. The worst thing that can happen with declare(strict_types=3D1), is that = code won=E2=80=99t work any more. The worst thing that can happen with declare(strict_operators=3D1), is = that code will change semantics. =E2=80=94Claude=