Object-oriented functionality in PHP supports the C++-style :: operator! ! !
//Lone Wolf: This:: appears frequently in PEAR. I was confused when I saw it for the first time :)
This feature document does not have any explanation, but it has very good use value.
Give a simple example:
For example, you have a lot of collected function libraries in the past, and you want to switch to OOP programming, but you cannot yet achieve complete encapsulation.
This feature provides you with an OOP style implementation.
You define a Util class:
class Util {
//Clip all functions here
//This class can not have any member functions
}
Then in your original Where a function is used, such as someFunction(), change it to:
Util::someFunction(). This is very useful when you need to encapsulate but do not need any member functions.