I\'ve been examining the code of CodeIgniter and CakePHP and I noticed that some of the methods in their classes are prefixed with an underscore _
or a double u
In the case where it is not any of PHP's magic methods, it is to indicate Visibility in lack of proper Visibility keywords:
Cake Coding Conventions:
As we cannot use PHP5's private and protected keywords for methods or variables, we agree on following rules:
- A protected method or variable name start with a single underscore ("_").
- A private method or variable name start with double underscore ("__").
CodeIgniter conventions:
Methods and variables that are only accessed internally by your class, such as utility and helper functions that your public methods use for code abstraction, should be prefixed with an underscore.