Bug #16567 [Com]: Deprecated: Assigning the return value & Deprecated: Function eregi()
| From: | pear@pascal.corpet.net | Date: | Tue, 01 Jun 2010 19:12:32 +0000 |
| Subject: | Bug #16567 [Com]: Deprecated: Assigning the return value & Deprecated: Function eregi() | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-3842@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=16567&edit=1
ID: 16567
Comment by: pear@pascal.corpet.net
Reported By: n dot vignjevic at nao-company dot com
Summary: Deprecated: Assigning the return value & Deprecated:
Function eregi()
Status: Open
Type: Bug
Package: XML_Parser
Operating System: All
Package Version: 1.3.2
PHP Version: 5.3.0
Roadmap Versions:
New Comment:
@zigo, I didn't notice you wrote "if you like" in your comment. I would
very much enjoy a way of fixing this issue on debian; so if you can
contact them, please do.
Previous Comments:
------------------------------------------------------------------------
[2010-05-27 21:37:44] caribou
Correcting the erig is easy: preg_match function works in both PHP4 and
PHP 5.3. The patch I sumbitted earlier takes care of this warning.
------------------------------------------------------------------------
[2010-05-27 10:10:23] zigo
That might be correct for returning a value as reference. However,
testing against the PHP version for choosing eregi preg_match WILL work.
I will involve the Debian pkg-php-pear team if you like, so that they
can find a solution for the returning a reference issue.
------------------------------------------------------------------------
[2010-05-26 23:48:19] caribou
@zigo: I just tried the following.
file test2.php:
if (false)
$a =& new A();
file test.php:
error_reporting(E_ALL);
require_once 'test2.php';
I get a warning for deprecated return value of new.
In this case the warning is not for the function but for the use of "=&
new". So the patch I submit won't work. :-(
If you find a way, please tell me.
------------------------------------------------------------------------
[2010-05-26 02:32:31] zigo
That's absolutely wrong. A function that is not called will NOT
generate a warning before it's called. Why? Because you can create
function dynamically, so it would be wrong to display a warning. So your
argument doesn't work, and you can still change your code to use
preg_match instead of ereg.
Anyway, using ereg in PHP6 is not only deprecated and display a notice:
it will crash as the function has been removed. So, even if what you
pretend was right (it is not), then what would you prefer ? Be totally
incompatible with the new version, simply because you don't want a
warning in the antediluvian version? It doesn't make sense at all.
Please correct the current version of XML_Parser so that we don't have
to carry-on distribution specific patches (Debian, in my case), which
are a pain to maintain and that will be different in each distribution.
------------------------------------------------------------------------
[2010-05-25 21:11:35] caribou
@zigo : this is not possible because PHP will parse the wrongful code
anyhow and issue the warning (even if it will never be actually run)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=16567
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=16567&edit=1