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 » Bug #5581

negotiateLanguage() throws fatal error in PHP 5

Details

Submitted2005-10-02 19:13 UTC
Frommako at mako-home dot de
Assignedmike
StatusClosed
PackageHTTP
PHP Version5
OSirrelevant
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"