Bug #13319 Updated: ereg_replace() with numeric 2nd argument

From: Date: Sat, 15 Sep 2001 17:42:29 +0000
Subject: Bug #13319 Updated: ereg_replace() with numeric 2nd argument
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-66017@lists.php.net to get a copy of this message
ID: 13319 Updated by: sterling Reported By: joseph_a@mail.ru Status: Closed Bug Type: Regexps related Operating System: Linux PHP Version: 4.0.6 New Comment: This is impossible due to the fact that ereg_replace() supports the specifying of ascii values as a replacement argument. Previous Comments: ------------------------------------------------------------------------ [2001-09-15 13:26:03] joseph_a@mail.ru But preg_replace('/4/', 3, '124') will produce '123' as expected. Even if it's not a bug, it still would be nice if that number would be autoconverted to string. ------------------------------------------------------------------------ [2001-09-15 13:11:31] swm@php.net closed. ------------------------------------------------------------------------ [2001-09-15 13:11:01] swm@php.net You are correct in saying that the second argument is a 'replacement string', not a number. The documentation is very clear about this. ------------------------------------------------------------------------ [2001-09-15 12:13:10] joseph_a@mail.ru When using ereg_replace() with a numeric 2nd argument (replacement string), this argument is treated as an empty string. ereg_replace('4', 3, '124') produces '12' instead of '123'. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13319&edit=1

« previous php.dev (#66017) next »