I have a function Create(). It's a single function with no formal arguments declared.
Here, how it's supposed to be used:
Code: Select all
function Create($Type = null, $Title = null, $Icon = null, $URL = null, $Target = null, $Sort = null, $Active = null);
function Create($Type = null, $Title = null, $Icon = null, $Sort = null, $Active = null);
function Create($Type = null, $Sort = null, $Active = null);
First, I'm getting list of the arguments.
Code: Select all
$Arguments = func_get_args();
if(count($Arguments) > 0)
{
switch($Arguments[0])
{How would you solve that problem? I have a couple of ideas with using arrays, but I want to hear your opinion.
P.S. No native support of overloading and no readonly properties makes me angry.