rfc:class_const_visibility

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:class_const_visibility [2015/10/20 17:34] sean-derrfc:class_const_visibility [2015/10/28 15:06] – RFC was accepted! sean-der
Line 23: Line 23:
  
 Class constant may be define as public, private or protected. class constants declared Class constant may be define as public, private or protected. class constants declared
-without any explict visibility keyword are defined as public. +without any explicit visibility keyword are defined as public. 
  
 Proposed syntax: Proposed syntax:
Line 38: Line 38:
         protected const PROTECTED_CONST = 0;         protected const PROTECTED_CONST = 0;
         public const PUBLIC_CONST_TWO = 0;         public const PUBLIC_CONST_TWO = 0;
 +        
 +        //Constants can only have one visibility declaration list
 +        private const FOO = 1, BAR = 2;
 } }
  
  
-//Interfaces only support protected/public const, and a compile time error will be throw for privates+//Interfaces only support public consts, and a compile time error will be thrown for anything else. Mirroring the behavior of methods.
 interface ICache { interface ICache {
         public const PUBLIC = 0;         public const PUBLIC = 0;
- protected const PROTECTED 0; +        const IMPLICIT_PUBLIC 1;
- +
- public function get($k, $v); +
- public function set($k);+
 } }
  
Line 94: Line 94:
 There will be new _ex APIs that allow callers to explicitly pass flags. There will be new _ex APIs that allow callers to explicitly pass flags.
  
-If a extension accesses non-public structures (the now non-existant class_constants HashTable) there will be breakage+If a extension accesses non-public structures (the now non-existent class_constants HashTable) there will be breakage
  
 ==== To Opcache ==== ==== To Opcache ====
Line 103: Line 103:
  
 Simple Yes/No option. This requires a 2/3  majority. Simple Yes/No option. This requires a 2/3  majority.
 +
 This vote will close on 06:00 UTC on Tuesday 2015-10-27 This vote will close on 06:00 UTC on Tuesday 2015-10-27
  
-<doodle title="Class Constant Visibility" auth="sdubois" voteType="single" closed="false">+<doodle title="Class Constant Visibility" auth="sdubois" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
rfc/class_const_visibility.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1