Re: Missing reflection info about strict types?

From: Date: Mon, 05 Sep 2016 21:09:24 +0000
Subject: Re: Missing reflection info about strict types?
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-95677@lists.php.net to get a copy of this message
Hi Nikita, Nikita Popov wrote:
As I see it, the issue here is really not how to figure out whether a file uses strict_types, the issue is how you mix strict_types=1 and strict_types=0 code in a single file.
This is also my assessment.
Back when this feature was introduced, we decided not to allow this kind of mixing, as it seemed prone to causing a mess and use-cases seemed doubtful. Given the issue Symfony is experiencing, we should reevaluate this decision. Imho it's not good if there are some things you simply *cannot* express in a single file.
I think it was things like this that made me initially allow having multiple strict_types declarations in a file. But that was changed later. Maybe we could allow it, but only with the block syntax, much as we do with namespaces? i.e.: declare (strict_types=1) { } declare (strict_types=0) { } Or we could allow any number of non-block strict_types declarations if we wanted. I don't know. -- Andrea Faulds https://ajf.me/

« previous php.internals (#95677) next »