Re: Proposal to run all tests with and without strict_types enabled
| From: | Rowan Collins | Date: | Mon, 12 Feb 2018 21:05:45 +0000 |
| Subject: | Re: Proposal to run all tests with and without strict_types enabled | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-101855@lists.php.net to get a copy of this message | ||
On 12 February 2018 05:50:56 GMT+00:00, Pedro Lacerda <pslacerda@gmail.com> wrote:
>Besides testing, may or may not be valuable expose a
>
__STRICT_TYPES__
>constant.
I think adding this to the language would be very controversial, because it opens up the ability to
undermine the "caller decides" concept of the two scalar type modes. People on this list
have openly said that they would like to force users to call their library from strict mode, and
others (myself included) would rather that wasn't possible. On the other hand, there were a
handful of cases suggested where such an indicator would be useful to *emulate* the two modes in
functions with more complex signatures.
For testing purposes, it would presumably be enough for run-tests.php itself to expose whether the
strict types override was in effect, which would sidestep the wider issue.
Regards,
--
Rowan Collins
[IMSoP]