On 13/08/2019 18:40, Liam Hammett wrote:
<?php
declare(strict_types=1) {
class Example {
// ...
}
}
This already works (except for the "encoding" declare, which would make
little sense halfway down a file).
spl_autoload_register(function ($className) {
declare(strict_types=1) {
include $className . '.php';
}
});
This, however, doesn't, because each file has to declare its own
options, so we'd need some new syntax for "include with current parser
options". It would also lead to the possibility for the same file to be
included twice with different options, which would be confusing; or for
it to be in OpCache twice with different options, which would be complex
to implement.
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php