Home » HTTP » HTTP » Bug #5581
negotiateLanguage() throws fatal error in PHP 5
Details
| Submitted | 2005-10-02 19:13 UTC |
|---|---|
| From | mako at mako-home dot de |
| Assigned | mike |
| Status | Closed |
| Package | HTTP |
| PHP Version | 5 |
| OS | irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-10-02 19:13 UTC] mako at mako-home dot de
Description:
------------
Calling HTTP::negotiateLanguage() throws an error:
"Fatal error: Only variables can be passed by reference in HTTP.php on line 137"
Changing line 137 to
$matches = array_keys($matches);
return $supp[array_pop($matches)];
fixes the error.
Test script:
---------------
<?php
require_once("HTTP.php");
$strLang = HTTP::negotiateLanguage(array("de", "en", "fr"), "de");
echo $strLang;
?>
Expected result:
----------------
Should output the negotiated language, e.g. "de"
Actual result:
--------------
"Fatal error: Only variables can be passed by reference in HTTP.php on line 137"