Re: [nyphp-talk] More type casting help

2007-07-02 Thread Cliff Hirsch
Ignore my solution ‹ hasty and wrong. On 7/2/07 3:07 PM, "Cliff Hirsch" <[EMAIL PROTECTED]> wrote: > in_array($value, $options, true) solves issues with type conversion (like > Œfoobar¹ == (int)0) > > But what about the equivalent for a key search? > > array_key_exists ( mixed key, array search

[nyphp-talk] More type casting help

2007-07-02 Thread Cliff Hirsch
in_array($value, $options, true) solves issues with type conversion (like Œfoobar¹ == (int)0) But what about the equivalent for a key search? array_key_exists ( mixed key, array search ) performs automatic type conversion ‹ evil. I came up with: count(array_keys($options, $value, true)) === 0