Chaim Frenkel wrote:
> 
> Removing -1 as a valid result, could be a breakage (if someone is
> doing something weird with a negative result)

What, like using it as an index into a substr?
Bad Code is its own reward, my friend.


>       $foo = "flabergasted";
>       substr($foo, index($foo, 'abc'), 20);   # Returns undef

One should never do this, regardless of what index() returns on
failure.  Now, if index() threw an exception on failture, you'd
be o.k.  But I don't think we want that...

-- 
John Porter

        We're building the house of the future together.

Reply via email to