Is it possible to have a php function with two names?

An odd question, but I'm stuck in an old function library that is still in use. My question is: is it possible to have a function with two names? i.e:

function fReturnFormatedDateOrNull($string, $switch=1), fDoN ($string, $switch=1) {
  gutshere
}

I hate namespace / name length, but I need to save the function. I would like to use an abbreviated name (fDoN) in the future. Or am I stuck in creating a new function and calling it old?

Thank you for your time.

+3
source share
2 answers

Just indicated, No

However, you can do this to simplify ...

function fReturnFormatedDateOrNull($string, $switch=1) {
    gutshere
}

function fDoN($string, $switch=1) {
    fReturnFormatedDateOrNull($string,$switch);
}
+6
source

You can use function variables

0
source

All Articles