Home » HTTP » HTTP_Header » Bug #5830
Fatal error: Only variables can be passed by reference in /usr/local/share/php/
Details
| Submitted | 2005-10-31 10:05 UTC |
|---|---|
| From | jeroen at terena dot nl |
| Assigned | mike |
| Status | Closed |
| Package | HTTP_Header |
| PHP Version | 5.0.5 |
| OS | debian |
| 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/