#24687 [Ana->Opn]: Fatal error: Only variables or references can be returned by reference
From: sniper@php.net Date: Mon, 18 Aug 2003 14:22:36 +0000 Subject: #24687 [Ana->Opn]: Fatal error: Only variables or references can be returned by reference References: 1 Groups: php.bugs Request: Send a blank email to php-bugs+get-46099@lists.php.net to get a copy of this message
ID: 24687
Updated by: sniper@php.net
Reported By: nologic at pchome dot com dot tw
-Status: Analyzed
+Status: Open
Bug Type: Zend Engine 2 problem
Operating System: windows2000sp4
PHP Version: 5CVS-2003-07-16 (dev)
Assigned To: zeev
Previous Comments:
------------------------------------------------------------------------
[2003-08-16 04:14:19] jan at horde dot org
Any idea yet if this will be fixed/addressed or should we start
converting scripts to not use referenced return type or build variables
that get returned?
------------------------------------------------------------------------
[2003-07-24 03:16:39] mikkel at linet dot dk
I have the same problem with PHP5 snap 200307240730, PEAR DB will not
work, as many functions has "&" in front of them. So a "return new
DB_Result" does not work.
Mayby this should only be a "notice" instead of a "fatal" error.
------------------------------------------------------------------------
[2003-07-22 11:53:29] zeev@php.net
Yes, it is quite complicated. You can only return variables by
reference, a function's return value is not something we can 'connect'
to...
------------------------------------------------------------------------
[2003-07-17 03:35:38] derick@php.net
If you do it like this it works:
class TextSanitizer
{
function &htmlSpecialChars($text) {
$foo = preg_replace("/&/i", '&', htmlspecialchars($text,
ENT_QUOTES));
return $foo;
}
}
So would it really be *that* hard to make it work?
------------------------------------------------------------------------
[2003-07-17 03:23:15] zeev@php.net
It never really worked (caused memory corruption).
Unlikely to be changed, since it doesn't make sense, but we'll see.
------------------------------------------------------------------------
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://bugs.php.net/24687
--
Edit this bug report at http://bugs.php.net/?id=24687&edit=1
Thread (19 messages)
- #24687 [Opn->Bgs]: Fatal error: Only variables or references can be returned by reference
- #24687 [Bgs->Opn]: Fatal error: Only variables or references can be returned by reference
- #24687 [Opn->Ana]: Fatal error: Only variables or references can be returned by reference
- #24687 [Ana]: Fatal error: Only variables or references can be returned by reference
- #24687 [Ana->Asn]: Fatal error: Only variables or references can be returned by reference
- #24687 [Asn->Ana]: Fatal error: Only variables or references can be returned by reference
- #24687 [Com]: Fatal error: Only variables or references can be returned by reference
- #24687 [Com]: Fatal error: Only variables or references can be returned by reference
- #24687 [Ana->Opn]: Fatal error: Only variables or references can be returned by reference
- #24687 [Opn->WFx]: Fatal error: Only variables or references can be returned by reference
- #24687 [Com]: Fatal error: Only variables or references can be returned by reference
- #24687 [Com]: Fatal error: Only variables or references can be returned by reference
- #24687 [WFx->Opn]: Fatal error: Only variables or references can be returned by reference
- #24687 [Com]: Fatal error: Only variables or references can be returned by reference
- #24687 [Com]: Fatal error: Only variables or references can be returned by reference
- #24687 [Com]: Fatal error: Only variables or references can be returned by reference
- #24687 [Opn->Asn]: Fatal error: Only variables or references can be returned by reference
- #24687 [Asn->Csd]: Fatal error: Only variables or references can be returned by reference
| « previous | php.bugs (#46099) | next » |
|---|