1

Maybe it's foolish question, And I want to implement some utils functions using OOP in PHP, instead SP (Strudtured Programming), but with uses like SP.

An example:

class A {
  public static function x() {
    echo "using x method!";
  }
}

According to Static OOP, to use the x function I need to use:

A::x();

But I want to use only:

x();

How can do it? Thk

Gordon
  • 312,688
  • 75
  • 539
  • 559

1 Answers1

2
function x() {
   return A::x();
}

Or you can even try to do:

function x() {
    return A::__FUNCTION__();
}
qwertynl
  • 3,912
  • 1
  • 21
  • 43