Re: Proposal to run all tests with and without strict_types enabled

From: Date: Mon, 12 Feb 2018 23:37:29 +0000
Subject: Re: Proposal to run all tests with and without strict_types enabled
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-101856@lists.php.net to get a copy of this message
2018-02-12 18:05 GMT-03:00 Rowan Collins <rowan.collins@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. -- Atenciosamente, Pedro Lacerda

« previous php.internals (#101856) next »