logo       

Re: Testing the existance of a value in an array: msg#00238

php.tcphp

Subject: Re: Testing the existance of a value in an array

Looking at phpinfo();

There is only brief mention of zend:
Zend Extension 20021010

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with DBG
v2.11.23, (C) 2000,2001,2002,2003, by Dmitri Dmitrienko

I would assume this means no.
I installed from the distribution RPM from Mandrake 10.1

I also tried running this script on a hurricane electric server (one
component, not the entire suite of tests whose output was in my last
message) and the behavior is the same.

Weird.


On 6/22/05, Mike Willbanks <pencap-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx>
wrote:
> Benjamin,
>
> Do you have the zend optimizer installed and if so did you upgrade it
> the last time that you updated your php installation? Also try
> upgrading your php installation to the latest release and also
> reinstalling your opimizer if you have one.
>
> That may help. I remember a while back I was having some big problems
> with arrays not really working correctly and some extra data being
> inserted into the array.
>
> Mike
>
> > And I've used in_array, array_search and a quick custom function
> > (replicating in_array's functionality) and the behavior is consistent
> > between functions, but still is not what is desired (or logical).
> >
> > PHP Version 4.3.8
> >
> > I have an array called $filter:
> >
> > Array
> > (
> > [0] => oid
> > [1] => app_edit_field_id
> > )
> >
> > and the in_array is returning screwy values:
> >
> > var_dump(in_array("oid",$filter));
> > bool(false)
> > var_dump(in_array("app_edit_field_id",$filter));
> > bool(true)
> >
> > Compare to using a different filter array:
> > Array
> > (
> > [0] => oid
> > [1] => app_edit_field_id
> > [2] => oid
> > )
> >
> > var_dump(in_array("oid",$filter));
> > bool(true)
> > var_dump(in_array("app_edit_field_id",$filter));
> > bool(false)
> > Lets try reversing the original array:
> > Array
> > (
> > [0] => app_edit_field_id
> > [1] => oid
> > )
> >
> > var_dump(in_array("oid",$filter));
> > bool(true)
> > var_dump(in_array("app_edit_field_id",$filter));
> > bool(false)
> >
> >
> > Just to be sure, lets try another array containing different values:
> >
> > Array
> > (
> > [0] => table_name
> > [1] => user_group
> > )
> > var_dump(in_array("table_name",$filter));
> > bool(false)
> > var_dump(in_array("user_group",$filter));
> > bool(true)
> >
> > Does this make any sense to anyone?
> > This seems horribly illogical! Any input would be greatly appreciated.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: talk-unsubscribe-4zcLI8jJc/rYtjvyW6yDsg@xxxxxxxxxxxxxxxx

Please read and follow the list guidelines:
http://www.tcphp.org/mailing_list/guidelines

The tcphp.org mailing list is sponsored by pajunas interactive, inc.




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise