On 19 February 2015 at 23:07, Anthony Ferrara <ircmax...@gmail.com> wrote: > All, > > An interesting point was brought up related to block mode: > https://twitter.com/drrotmos/status/568540722586107904 > > Namely that generated file caches may need the ability to switch block > mode on-and-off. > > I'm considering making the change to add that. If that happens, > declare must be the outermost block, and no non-declare blocks would > be allowed in the outermost scope of the file: > > <?php > declare(strict_types=1) { > //... > } > declare(strict_types=0) { > //... > } > > Having trailing code or code outside of the declare would be a compile error. > > <?php > declare(strict_types=1) { > //... > } > foo(); // compile error > > This behaves consistent with namespace block-mode today (though the > strict type declaration would be required to be outside the namespace > block). > > I'm considering adding it, as it's a valid use-case. What do you think?
Seems a valid use case, and the block solution is therefore the logical step. I see no reason to exclude it. Paddy -- Pádraic Brady http://blog.astrumfutura.com http://www.survivethedeepend.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php