RE: [PHP-DEV] Re: [RFC] Namespace and Parse tags on Include and Require

From: Date: Wed, 07 Mar 2012 09:26:20 +0000
Subject: RE: [PHP-DEV] Re: [RFC] Namespace and Parse tags on Include and Require
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
> Ok, with Hannes help I have the RFC up now.
>
> https://wiki.php.net/rfc/changes_to_include_and_require

WRT tagless files, in addition to the issues already raised by others:
- What about script execution? You'll still need a shebang (linux) or to register the extension
(Windows). Having a special shebang but making the <?php still optional seems silly. Conversely
not being able to start in script mode from the place most likely to only have script also makes no
sense.
- Apache will also not like these files very much. Possible to work around if you use a different
extension, but will present a huge problem for legacy server configurations (which will still be
ubiquitous for years after any such change).
- Autoloaders. Even if an extension convention is adopted this will be horribly painful. Consider
the work and additional (twice as many!!!) disk accesses required to make a simple autoloader for
PEAR convention libraries work with both formats.
- General code interoperability is a serious problem here too. If such a change were adopted
developers would have to open and examine any file prior to inclusion to ensure that they know which
format the file is in. Using the wrong type of include would be a huge problem.
- Closing the tag that wasn't opened in the middle of such a file would be incredibly strange
- I expect that this would create problems with the variety of opcode caches out there (since caches
would now need to become aware of which mode of file they have cached vs. which mode the file is
getting included in).

To me the autoloader and interoperability issues are the most critical because they directly impact
usability and performance basically everywhere.

John Crenshaw
Priacta, Inc.


Thread (9 messages)

« previous php.internals (#58725) next »