2018-02-12 18:05 GMT-03:00 Rowan Collins <rowan.coll...@gmail.com>:
> 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.
The current beharviour makes sense to me, if the caller don't know the
concept of strict types he must not be forced to handle it. I don't know
such examples where would be useful the callee emulate both signatures, can
you provide some? Something like correctly cast to the correct type? That
can make sense. But restrict the caller doesn't seems very valuable.
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.
Expose only through `run-tests.php` is safer for sure, it will not be
highlighted like other constants because `zend_highlight.c` wasn't modified
but whatever, it's only for tests.