You are here: Re: skipping arguments in function call « PHP Programming Language « IT news, forums, messages
Re: skipping arguments in function call

Posted by Aidan on 06/09/05 06:50

"Chuck Anderson" <websiteaddress@seemy.sig> wrote in message
news:Cs2dneTX7cMrNDrfRVn-1w@comcast.com...
> Aidan wrote:
>
>>My suggestion would be to reorganise the order in which the function takes
>>it arguments. Simply change it so that the 7th argument is the 5th, and
>>the 5th and 6th argumentss become the 6th and 7th.
>>
>>That's what I'd do at least. HTH
>>
> Well, yes, that would work. I can even supply the 5th and 6th arguments in
> this case, but I was wondering if that really is something that Php does
> not allow (the ,,, - method of skipping arguments) or if I need to look
> closer for another parse error.

Well, the method you're using is essentially (to the best of my knowledge)
passing null values to the arguments you're trying to skip. Here's a page
from php.net I think you should read:

http://au3.php.net/manual/en/functions.arguments.php#functions.variable-arg-list

HTH


>
>>
>>"Chuck Anderson" <websiteaddress@seemy.sig> wrote in message
>>news:houdnQf0jJq5CzrfRVn-hw@comcast.com...
>>
>>>I have a function with 7 inputs. The last three have default values.
>>>
>>>I want to call that function specifying the first four, skip two and then
>>>specify the last.
>>>
>>>I thought I could write this as :
>>>
>>>$retval = myfunction(arg1, arg2, arg3, arg4,,,arg7);
>>>
>>>... but Php does not seem to want to let me do this. I get a parse error
>>>until I supply values for the 5th and 6th arguments.
>>>
>>>My question is simply this; is skipping arguments like that not allowed
>>>in Php?
>>>
>>>--
>>>*****************************
>>>Chuck Anderson . Boulder, CO
>>>http://www.CycleTourist.com
>>>Integrity is obvious.
>>>The lack of it is common.
>>>*****************************
>>
>>
>>
>
>
> --
> *****************************
> Chuck Anderson • Boulder, CO
> http://www.CycleTourist.com
> Integrity is obvious.
> The lack of it is common.
> *****************************

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация