On Wed, Dec 3, 2008 at 2:01 AM, Matt Read <[EMAIL PROTECTED]> wrote:

>
> Just to jump in,
>
> count($_POST) _does_ work, as ArrayObject/Iterator implements
> Countable. Can you give any examples of where it was not working?


It does work. I'm saying we shouldn't have to use count() instead of
empty(), since that's not true of any other array (and as far as most people
will ever know, $_POST should still be an array... they treat it like one
99% of the time).

empty($_POST) does not work as you mentioned, cause it's an object and
> this is php5, and thus not empty.
>
> array_* functions will not work, and casting the superglobal to array
> will return the original unfiltered array. So if you pass a
> SuperGlobal to array_* you should call getArrayCopy and such.
>
> I like the idea of making $_P/G/C a filtered object. The only thing
> that doesn't work as expected is the empty() (which is a strange thing
> to do anyway), and array_* functions, which require you to call
> ->getArrayCopy(), get_array_copy_raw(), or cast to array. I personally
> like the way the superglobals behave, providing a nice way to "make it
> safe easy", without being too different from the normal "PHP way".


Like I said, I agree it's a great idea. It just doesn't pan out that way,
for all the reasons I've mentioned. It's one of those things that either
works perfectly or doesn't work at all, and this one certainly isn't
perfect.

-- 

Bob Dole  - "The internet is a great way to get on the net."

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/habari-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to