structured programming - Calling Static Method of Class WITHOUT classname, PHP -


maybe it's foolish question, , want implement utils functions using oop in php, instead sp (strudtured programming), uses sp.

an example:

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

according static oop, use x function need use:

a::x(); 

but want use only:

x(); 

how can it? thk

function x() {    return a::x(); } 

or can try do:

function x() {     return a::__function__(); } 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -