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.
- Re: RFC 213 (v1) rindex and index should return undef on... Nathan Torkington
- Re: RFC 213 (v1) rindex and index should return und... Chaim Frenkel
- Re: RFC 213 (v1) rindex and index should return... Nathan Torkington
- Re: RFC 213 (v1) rindex and index should re... Chaim Frenkel
- Re: RFC 213 (v1) rindex and index shoul... Nathan Torkington
- Re: RFC 213 (v1) rindex and index ... Chaim Frenkel
- Re: RFC 213 (v1) rindex and index ... Glenn Linderman
- Re: RFC 213 (v1) rindex and index ... John Porter
- Re: RFC 213 (v1) rindex and index ... Chaim Frenkel
- Re: RFC 213 (v1) rindex and index ... Glenn Linderman
- Re: RFC 213 (v1) rindex and index should return undef on... John Porter
- Re: RFC 213 (v1) rindex and index should return und... Glenn Linderman
- Re: RFC 213 (v1) rindex and index should return... Chaim Frenkel
- Re: RFC 213 (v1) rindex and index should re... Glenn Linderman
- Re: RFC 213 (v1) rindex and index shoul... Chaim Frenkel
- Re: RFC 213 (v1) rindex and index ... Glenn Linderman
- Re: RFC 213 (v1) rindex and index ... John Porter
- Re: RFC 213 (v1) rindex and index ... Glenn Linderman
- Re: RFC 213 (v1) rindex and index ... Nathan Torkington
- Re: RFC 213 (v1) rindex and index should return und... Chaim Frenkel