Bug #51413 [Wfx]: ereg() no longer works as in earlier versions
| From: | rasmus@php.net | Date: | Sat, 27 Mar 2010 17:01:09 +0000 |
| Subject: | Bug #51413 [Wfx]: ereg() no longer works as in earlier versions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-149105@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51413&edit=1
ID: 51413
Updated by: rasmus@php.net
Reported by: rprangnell at gmail dot com
Summary: ereg() no longer works as in earlier versions
Status: Wont fix
Type: Bug
Package: Program Execution
Operating System: Windows XP
PHP Version: 5.3.2
New Comment:
It is not for no apparent reason. It is because they upgraded without
reading
the UPGRADING documentation.
Previous Comments:
------------------------------------------------------------------------
[2010-03-27 17:52:30] rprangnell at gmail dot com
I can well appreciate why this bug is not going to be fixed - after all,
the ereg() function is now officially deprecated and should be replaced
by the preg_match() function. However, there must be many applications
out there that are still using ereg() and which will therefore suddenly
break for no apparent reason whenever the companies hosting such
applications upgrade to later versions of PHP.
------------------------------------------------------------------------
[2010-03-27 17:14:48] rasmus@php.net
Probably part of bringing everything under the same parameter handling
code.
This will have to be fixed in your application. And they really
shouldn't be
using ereg() anymore anyway. It is slower and doesn't support Unicode
at all.
All ereg() calls should be replaced with preg_match() calls. You will
notice
that the call will also throw an E_DEPRECATED warning in 5.3 letting you
know you
should be replacing those calls.
------------------------------------------------------------------------
[2010-03-27 17:03:16] rprangnell at gmail dot com
Description:
------------
PHP scripts that use the ereg() function and which worked properly in
earlier versions may no longer work because of a change in the way
ereg() deals with function arguments. Namely, ereg() now seems to check
the "expected argument" type and throws an error if the argument is of a
different type.
I came across this bug on a brand new, clean install of Drupal 6.3 with
the Ubercart ecommerce package. With PHP 5.3 running, certain images
would not display and multiple warning messages would pop up, each of
them detailing the culprit as ereg(). Simply by changing the running PHP
version to 5.2.11 cured all problems.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51413&edit=1