|
Posted by Andy Hassall on 04/16/07 19:51
On 15 Apr 2007 22:19:57 -0700, "lawrence k" <lkrubner@geocities.com> wrote:
>One thing I like about Ruby is the use of symbols when passing
>function parameters to a function. One thing I dislike about PHP is
>that if a function has 4 optional parameters but you want to do
>something with the 4th one, you need to put in something, perhaps
>empty strings, for the first 3 parameters, even though you've no
>interest in using them.
>
>I'm wondering if there is anyway to emulate the Ruby style with
>something like this:
>
>http://us2.php.net/manual/en/function.func-get-args.php
>
>Is there a way to get the parameters as an associative array? A
>numerically indexed array is just as useless as the normal style of
>passing arguments.
For an insane solution, search Google Groups for "This calls for the power of
Bobo the Clown" (seriously).
Otherwise, pass an associative array.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|