Skip to content

Instantly share code, notes, and snippets.

@berkes
Created December 29, 2011 10:08
Show Gist options
  • Save berkes/1533318 to your computer and use it in GitHub Desktop.
Save berkes/1533318 to your computer and use it in GitHub Desktop.
Why the Fuck is that argument not used to ... ahhh. That is why. Morons!
$client = new SoapClient($cad_url);
$count = count($args);
if ($count == 0) {
$response = $client->$method();
}
elseif ($count == 1) {
$response = $client->$method($args[0]);
}
elseif ($count == 2) {
$response = $client->$method($args[0], $args[1]);
}
elseif ($count == 3) {
$response = $client->$method($args[0], $args[1], $args[2]);
}
elseif ($count == 4) {
$response = $client->$method($args[0], $args[1], $args[2], $args[3]);
}
elseif ($count == 5) {
$response = $client->$method($args[0], $args[1], $args[2], $args[3], $args[4]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment