rfc:source_files_without_opening_tag
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:source_files_without_opening_tag [2012/04/10 23:42] – [Anticipated And Previously Raised Questions] boutell | rfc:source_files_without_opening_tag [2012/04/16 21:30] – Added the AS keyword to fix an ambiguity in the grammar (thanks to Nikita Popov) boutell | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Request for Comments: Source Files Without Opening Tag ====== | ====== Request for Comments: Source Files Without Opening Tag ====== | ||
- | * Version: 1.1 | + | * Version: |
- | * Date: 2012-04-10 | + | * Date: 2012-04-16 |
* Author: Thomas Boutell < | * Author: Thomas Boutell < | ||
* Status: Under Discussion | * Status: Under Discussion | ||
Line 22: | Line 22: | ||
2. Tedious. There is a small but real frustration involved in this redundancy. Small but real frustrations can contribute to long-term disenchantment with a programming language. | 2. Tedious. There is a small but real frustration involved in this redundancy. Small but real frustrations can contribute to long-term disenchantment with a programming language. | ||
- | However these same projects and frameworks may advocate the use of "raw HTML" in PHP files intended as templates for rendering pages, forms and the like. This is a longstanding feature of PHP (indeed the original feature of PHP). Support for it should be maintained, and may perhaps be improved in future to address PHP's current limitations as a templating language. This proposal aims not to close any doors in this regard. | + | However these same projects and frameworks may advocate the use of "raw HTML" in PHP files intended as templates for rendering pages, forms and the like. This is a longstanding feature of PHP (indeed the original feature of PHP). Support for it should be maintained, and may perhaps be improved in future to address PHP's current limitations as a templating language. The two modes should not be mutually exclusive as this makes it impossible for code to interoperate. This proposal aims not to close any doors in this regard. |
==== Related RFC ==== | ==== Related RFC ==== | ||
Line 32: | Line 32: | ||
=== Part 1: Enhance the include, include_once, | === Part 1: Enhance the include, include_once, | ||
- | These keywords will be enhanced with a second, optional parameter. | + | These keywords will be enhanced with a second, optional parameter |
The first parameter (the URL/ | The first parameter (the URL/ | ||
Line 54: | Line 54: | ||
| | ||
// Load filename.phpp. This file must consist purely of source code, no <?php or ?> tokens needed or permitted | // Load filename.phpp. This file must consist purely of source code, no <?php or ?> tokens needed or permitted | ||
- | require ' | + | require ' |
// Behaves just like include_once | // Behaves just like include_once | ||
- | include ' | + | include ' |
// Behaves just like require | // Behaves just like require | ||
- | include ' | + | include ' |
// Combine them all: includes only once, with a fatal error on failure, parsing in "code mode" | // Combine them all: includes only once, with a fatal error on failure, parsing in "code mode" | ||
- | include ' | + | include ' |
// Exactly the same as previous example | // Exactly the same as previous example | ||
- | require_once ' | + | require_once ' |
| | ||
=== Part 2: Filename Convention === | === Part 2: Filename Convention === | ||
Line 113: | Line 113: | ||
Bitwise flags are faster and also provide built-in error checking: use of a constant not defined by a particular version of PHP will generate a notice. Require statements are something PHP executes quite often, so generating unnecessary arrays and testing array values is an unnecessary performance hit. | Bitwise flags are faster and also provide built-in error checking: use of a constant not defined by a particular version of PHP will generate a notice. Require statements are something PHP executes quite often, so generating unnecessary arrays and testing array values is an unnecessary performance hit. | ||
- | ===== Changelog ===== | + | **"Why is the AS keyword necessary? Why not a comma?" |
- | * 2011-04-09 Yasuo Ohgaki: Added related RFC. | + | Since these keywords are language constructs, not functions, and their parameters |
- | * 2011-04-10 Thomas Boutell: removed misleading word " | + | |
+ | ===== Changelog ===== | ||
+ | * 2012-04-09 Yasuo Ohgaki: Added related RFC. | ||
+ | * 2012-04-10 Thomas Boutell: removed misleading word " | ||
+ | * 2012-04-10 Thomas Boutell: version 1.1. Replaced '' | ||
+ | * 2012-04-16 Thomas Boutell: added Nikita Popov' | ||
rfc/source_files_without_opening_tag.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1