PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #5893

DataObject.php:2716 Only variable references should be returned by reference

Details

Submitted2005-11-08 11:34 UTC
Fromnikolas dot hagelstein at googlemail dot com
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP Version4.4.1
OSLinux 2.4.30
Roadmaps(Not assigned)

Comments

[2005-11-08 11:34 UTC] nikolas dot hagelstein at googlemail dot com

Description:
------------
Version 1.361
DataObject.php:2716] Only variable references should be returned by reference
occurses on calling getlink()

2677 -> &getLink()
2716 -> return false;

Related the the changes in PHP 4.4.0

Test script:
---------------
error_reporting(E_ALL);
function & test_false_fail() {
return false;
}
test_false();

-----
Workaround would be something like:
$ret=false;
return $ret;

Expected result:
----------------
Should reproduce the error.

[2005-11-08 11:49 UTC] nikolas dot hagelstein at googlemail dot com

This happens everytime a constant like false/true/null is returned by reference. I do not know how to return this properly. Using a temporary varialble seems a little ugly to me.