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
These are Magic Methods in PHP classes:
The function names
__construct, __destruct, __call, __callStatic, __get, __set, __isset, __unset, __sleep, __wakeup, __toString, __invoke, __set_stateand__cloneare magical in PHP classes. You cannot have functions with these names in any of your classes unless you want the magic functionality associated with them.
A method with one underscore has no special meaning. This is more likely some coding convention of the projects.