rfc:php_namespace_policy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:php_namespace_policy [2020/07/16 20:59] crellrfc:php_namespace_policy [2020/07/26 16:05] crell
Line 3: Line 3:
   * Date: 2020-04-15    * Date: 2020-04-15 
   * Author: Mark Randall (marandall@php.net), Larry Garfield (larry@garfieldtech.com)   * Author: Mark Randall (marandall@php.net), Larry Garfield (larry@garfieldtech.com)
-  * Status: Under Discussion+  * Status: In Voting
   * First Published at: https://wiki.php.net/rfc/php_namespace_policy   * First Published at: https://wiki.php.net/rfc/php_namespace_policy
  
Line 36: Line 36:
   - The \Ext vendor namespace is reserved for use by classes provided by a PHP extension, either bundled with PHP or hosted with PECL.  While userland code that makes use of that namespace will technically run, any impact on such code by future RFCs will not be considered a backward compatibility break.   - The \Ext vendor namespace is reserved for use by classes provided by a PHP extension, either bundled with PHP or hosted with PECL.  While userland code that makes use of that namespace will technically run, any impact on such code by future RFCs will not be considered a backward compatibility break.
   - Any namespaced code provided by PHP-SRC will use a distinct component namespace.  That is, no PHP\Foo class may be defined, but a PHP\Foo\Bar class may be.   - Any namespaced code provided by PHP-SRC will use a distinct component namespace.  That is, no PHP\Foo class may be defined, but a PHP\Foo\Bar class may be.
-  - Component namespaces should be singular.  That is, \PHP\Attribute, not \PHP\Attributes. 
   - Component or sub-component namespaces MUST use CamelCase naming conventions.   - Component or sub-component namespaces MUST use CamelCase naming conventions.
   - Only classes and other autoloadable symbols (as specified above) may be namespaced.  Constants should be associated to a class within the namespace as appropriate.   - Only classes and other autoloadable symbols (as specified above) may be namespaced.  Constants should be associated to a class within the namespace as appropriate.
Line 92: Line 91:
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
-PHP 8.0+PHP 8.0 (doesn't really have an impact until 8.1, however)
  
 ===== Vote ===== ===== Vote =====
-Yes / No  
  
-"Should PHP adopt these guidelines for future RFC authors to guide when and how to use the \PHP namespace for userland-accessible classes and similar?"+Voting opened 2020-07-26 and closes 2020-08-09. 
 + 
 +Yes / No vote, requiring 2/3 to pass. 
 + 
 +"Should PHP adopt these guidelines for future RFC authors to guide when and how to use the \PHP and \Ext namespaces for userland-accessible classes and similar?" 
 + 
 + 
 +<doodle title="Adopt this policy for future symbols defined by php-src and extension code?" auth="crell" voteType="single" closed="false"> 
 +   * Yes 
 +   * No 
 +</doodle>
  
 ===== Prior Art ==== ===== Prior Art ====
 https://wiki.php.net/rfc/namespaces-in-core (withdrawn) https://wiki.php.net/rfc/namespaces-in-core (withdrawn)
  
rfc/php_namespace_policy.txt · Last modified: 2020/08/10 13:41 by crell