NYCPHP Meetup

NYPHP.org

[nycphp-talk] Second time array_walk failed for me

Phil Powell soazine at erols.com
Thu Nov 6 23:16:40 EST 2003


According to the manual:

Applies the user-defined function function to each element of the array
array. Typically, function takes on two parameters. The array parameter's
value being the first, and the key/index second. If the optional userdata
parameter is supplied, it will be passed as the third parameter to the
callback function.

[see http://www.php.net/manual/en/function.array-walk.php]

This then indicates $array, which Daniel used as his parameter name, is NOT
an array, BUT a string, as is also in my case, lest his assignment:

$array = 'I have changed you!';

Be invalid because you are assigning a scalar value to an array (using
http://www.php.net/manual/en/language.types.array.php in the manual as my
backup), so therefore, I believe $array is a string, not an actual array,
based on these findings.



Phil



----- Original Message ----- 
From: "Chris Shiflett" <shiflett at php.net>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Thursday, November 06, 2003 11:10 PM
Subject: Re: [nycphp-talk] Second time array_walk failed for me


> --- Phil Powell <soazine at erols.com> wrote:
> > $array =  strtoupper($array);
>
> An array is not a string. That's your problem.
>
> As for thinking that there is a bug and your general approach to asking
> questions, you should really take the time to read this:
>
> http://www.catb.org/~esr/faqs/smart-questions.html
>
> Specifically, this is relevant:
>
> --------------------------------------------------
> Don't claim that you have found a bug
>
> When you are having problems with a piece of software, don't claim you
> have found a bug unless you are very, very sure of your ground. Hint:
> unless you can provide a source-code patch that fixes the problem, or a
> regression test against a previous version that demonstrates incorrect
> behavior, you are probably not sure enough.
>
> Remember, there are a lot of other users that are not experiencing your
> problem. Otherwise you would have learned about it while reading the
> documentation and searching the Web (you did do that before complaining,
> didn't you?). This means that very probably it is you who are doing
> something wrong, not the software.
>
> The people who wrote the software work very hard to make it work as well
> as possible. If you claim you have found a bug, you'll be implying that
> they did something wrong, and you will almost always offend them - even
> when you are correct. It's especially undiplomatic to yell "bug" in the
> Subject line.
>
> When asking your question, it is best to write as though you assume you
> are doing something wrong, even if you are privately pretty sure you have
> found an actual bug. If there really is a bug, you will hear about it in
> the answer. Play it so the maintainers will want to apologize to you if
> the bug is real, rather than so that you will owe them an apology if you
> have messed up.
> --------------------------------------------------
>
> Hope that helps.
>
> Chris
>
>
> =====
> My Blog
>      http://shiflett.org/
> HTTP Developer's Handbook
>      http://httphandbook.org/
> RAMP Training Courses
>      http://www.nyphp.org/ramp
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk




More information about the talk mailing list