In PHP we can have a class like the following:
class Test {
public static function xxx() {
//hacer algo
}
public static function yyy() {
//hacer algo
}
public static function zzz() {
//hacer algo
}
public static function mi_test() {
//Llamada literal al método de la propia clase
Test::xxx();
//Llamadas usando referencias
self::yyy();
self::zzz();
}
} //class
Calling methods one way or another seems to work the same, are there differences?
I have observed, for example, that with the literal calls it is easier to locate errors, due to erroneous calls, in case of restructuring / refactoring the classes and moving methods, although I did not find preferences for one or the other in lists of good practices, then is it recommended one way over the other, in what cases and why?