rfc:namespacecurlies
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:namespacecurlies [2008/08/31 13:15] – helly | rfc:namespacecurlies [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Request for Comments: | + | ====== Request for Comments: |
* Version: 1.0 | * Version: 1.0 | ||
* Date: 2008-08-31 | * Date: 2008-08-31 | ||
Line 11: | Line 11: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | During alpha phase of PHP 5.0 ther was a namespace implementation that was very close to the one of C++. Because an inconsistency between namespace separator '::' | + | During alpha phase of PHP 5.0 there was a namespace implementation that was very close to the one of C++. Because an inconsistency between namespace separator '::' |
The following issues have been identified: | The following issues have been identified: | ||
Line 34: | Line 34: | ||
- Nearly all C++ editors are set to not indent on namespaces. | - Nearly all C++ editors are set to not indent on namespaces. | ||
- | | + | |
- Java and C++ are the closest, wide spread languages that support namespaces. | - Java and C++ are the closest, wide spread languages that support namespaces. | ||
- | - C++ uses the keywords ' | + | - C++ uses the keywords ' |
- Java uses the keywords ' | - Java uses the keywords ' | ||
Line 44: | Line 44: | ||
- With the new implementation and no blocks, many people expected one namespace per file. | - With the new implementation and no blocks, many people expected one namespace per file. | ||
- Since fewer files means faster execution, many people simply concatenate PHP scripts. Their expectation is to be able to do this for code that uses namespaces as well. | - Since fewer files means faster execution, many people simply concatenate PHP scripts. Their expectation is to be able to do this for code that uses namespaces as well. | ||
- | - PHP will add [[php.net/ | + | - PHP will add [[http://php.net/ |
* Consistency: | * Consistency: | ||
Line 50: | Line 50: | ||
- The alternative is to use ' | - The alternative is to use ' | ||
- Only control structures can be followed by a statement without either ';' | - Only control structures can be followed by a statement without either ';' | ||
+ | |||
+ | * Issues: | ||
+ | - When concatenating a file with a namespace and one without a namespace, the second file gets pulled into the namespace unless the namespace used curly braces. | ||
==== Statements outside namespaces ==== | ==== Statements outside namespaces ==== | ||
Line 58: | Line 61: | ||
--foo.php | --foo.php | ||
- | | + | |
function test{} { | function test{} { | ||
echo __NAMESPACE__ . " | echo __NAMESPACE__ . " | ||
Line 86: | Line 89: | ||
We propose to add namespaces as block structures and drop ' | We propose to add namespaces as block structures and drop ' | ||
+ | |||
+ | In a second step nesting namespaces should be supported. This can easily be done by simply removing the corresponding error messages. | ||
===== Changelog ===== | ===== Changelog ===== |
rfc/namespacecurlies.1220188503.txt.gz · Last modified: 2017/09/22 13:28 (external edit)