Issues

ZF-8878: Set of "Parameter 1 to array_multisort() expected to be a reference, value given" for PHP 5.3.1 environment

Description

{panel} 1) testSortingResult(Zend_Search_Lucene_SearchTest) Parameter 1 to array_multisort() expected to be a reference, value given /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene.php:1045 /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene.php:1045 /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene/Proxy.php:346 /home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Search/Lucene/SearchTest.php:456

2) testLimitingResult(Zend_Search_Lucene_SearchTest) Parameter 1 to array_multisort() expected to be a reference, value given /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene.php:1045 /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene.php:1045 /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene/Proxy.php:346 /home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Search/Lucene/SearchTest.php:479

3) testSortingResult(Zend_Search_Lucene_Search23Test) Parameter 1 to array_multisort() expected to be a reference, value given /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene.php:1045 /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene.php:1045 /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene/Proxy.php:346 /home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Search/Lucene/Search23Test.php:513

4) testSortingResultByScore(Zend_Search_Lucene_Search23Test) Parameter 1 to array_multisort() expected to be a reference, value given /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene.php:1045 /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene.php:1045 /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene/Proxy.php:346 /home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Search/Lucene/Search23Test.php:533

5) testLimitingResult(Zend_Search_Lucene_Search23Test) Parameter 1 to array_multisort() expected to be a reference, value given /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene.php:1045 /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene.php:1045 /home/cawa/ZendFramework/svn/framework/trunk/library/Zend/Search/Lucene/Proxy.php:346 /home/cawa/ZendFramework/svn/framework/trunk/tests/Zend/Search/Lucene/Search23Test.php:569 {panel}

Comments


call_user_func_array('array_multisort', $sortArgs);

makes a copy of $sortArgs and transfers elements into values (references are required).


call_user_func_array('array_multisort', &$sortArgs);

helps, but this syntax is marked as deprecated.

Previous comment is incorrect. the problem is caused by transferring "reference" into "value" when number of references is reduced to 1:


$sortArgs[] = &$valuesArray;
unset($valuesArray); // At this moment $sortArgs array element is trunsferred 
                     // from arrray reference into array

Fixed