Re: [PHP4BETA] ereg_replace update
| From: | Andrey Zmievski | Date: | Wed, 18 Aug 1999 13:19:07 +0000 |
| Subject: | Re: [PHP4BETA] ereg_replace update | ||
| References: | 1 2 3 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-3543@lists.php.net to get a copy of this message | ||
George Hartz wrote:
> The problem definately seems to be a very non-standard way of casting
> integers to strings.
>
> Does anyone actually know if this is a bug, or just the way it works? If
> its just the way it works, why is that? It seems very non-standard.
ereg_replace() internally checks if the replace argument is a string. If
it's not it converts it to a number and then uses it as a character value,
which results in the problem you're experiencing. I don't know why it was
done that way, and it's not obvious how to fix it, since many programs may
depend on this behavior.
-Andrey
* All of the above is my opinion, unless specified otherwise. *