FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Sending nothing when function expects variable
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Sending nothing when function expects variable [message #178965 is a reply to message #178961] Tue, 28 August 2012 08:23 Go to previous message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma:
Senior Member
In article <03b15810-f401-4ad2-a1a4-c4f10f0f311e(at)googlegroups(dot)com>,
Jason C <jwcarlton(at)gmail(dot)com> wrote:

> I have a function like:
>
> function whatever($a, $b, $c) {
> if (!$b) $b = "something";
> if (!$c) $c = "something else";
>
> // etc
> }
>
> Since I'm checking for $b and $c in the function, I call the functions like
> this when $b and $c are going to be the defaults:
>
> whatever('this thing');
>
> But then in the error log, I get these warnings:
>
> PHP Warning: Missing argument 2 for q()...
> PHP Warning: Missing argument 3 for q()...
>
> Does this mean that I need to go back through all of the scripts (dozens of
> them) and change all of the whatever() references to:
>
> whatever('this thing', false, false);
>
> or is there a way to set PHP to ignore this warning by default?

No, it means you need to do a bit of your own research before posting.
Y'know, like thinking to yourself: "Ooh, this is a question about
function arguments, how about I read up in the PHP online
donkeymentation about function arguments to see if there is something
useful there that I could apply to my situation?" kind of thing.

Then when that stuff is unclear or there are some salient details that
are missing from the online manual, *then* you could post here. How
about that eh?

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How can i know the propery of a javascript object how can i see what object inclue
Next Topic: Folder Permissions
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 11:44:42 GMT 2024

Total time taken to generate the page: 0.05146 seconds