PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTTP » HTTP_Header » Bug #5830

Fatal error: Only variables can be passed by reference in /usr/local/share/php/

Details

Submitted2005-10-31 10:05 UTC
Fromjeroen at terena dot nl
Assignedmike
StatusClosed
PackageHTTP_Header
PHP Version5.0.5
OSdebian
Roadmaps(Not assigned)

Comments

[2005-10-31 10:05 UTC] jeroen at terena dot nl

Description:
------------
Calling send->headers() triggers a fatal error in PHP 505

Fatal error: Only variables can be passed by reference in /usr/local/share/php/

Similar errors occur in other packages.scripts as well due to a change in behaviour between php 5.0.4 and 5.0.4+ IIRC

Test script:
---------------
$httpCache = new HTTP_Header_Cache();
$httpCache->setLastModified($this->modified);
$httpCache->sendHeaders();

Expected result:
----------------
no error. Patch:

function getCacheStart()
{
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && !$this->isPost()) {
$bits = explode(';', $_SERVER['HTTP_IF_MODIFIED_SINCE']);
$time = array_shift($bits);
$timestamp = strtotime($time);
return $timestamp;
}
return time();
}

Actual result:
--------------
Fatal error: Only variables can be passed by reference in /usr/local/share/php/