On Fr, 2019-05-10 at 15:14 +0200, Lynn wrote: > Hi Nikita, > > By limiting a header file to declaring code only, a couple of issues > could > be tackled: > > 1. No side effects when loading files. You can assume the global > state > remains the same, no > code is executed by this file, and no output can be sent.
Mind that this won't be side-effect free. Declaring a class/function is a side-effect in itself. For dealing with syntax differences we could use the declare() statement, as used for strict_types or encoding. A question is whether it is worthwhile to have multiple syntaxes in parallel. This adds burden for developers using PHP, (i.e. copying code from tutorials or other files might fail sometimes etc.) tools processing PHP (IDEs, code analyzers, ...) and language developers (new syntax changes have to be evaluated for both contexts) If this were a strategy to transition to a new syntax (deprecating "old PHP") such a mechanism would be the way to go. For just having alternatives to avoid a syntax conflict cost imo is too big. johannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php