Issues

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

Issue Type: Unit Tests: Problem Created: 2010-01-20T02:31:46.000+0000 Last Updated: 2010-01-20T04:34:01.000+0000 Status: Resolved Fix version(s): - 1.10.1 (10/Feb/10)

Reporter: Alexander Veremyev (alexander) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Search_Lucene

Related issues: - ZF-8347

Attachments:

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

  1. 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

  2. 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

  3. 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

  4. 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

Posted by Alexander Veremyev (alexander) on 2010-01-20T02:35:21.000+0000

<pre class="highlight">
call_user_func_array('array_multisort', $sortArgs);

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

<pre class="highlight">
call_user_func_array('array_multisort', &$sortArgs);

helps, but this syntax is marked as deprecated.

Posted by Alexander Veremyev (alexander) on 2010-01-20T02:50:37.000+0000

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

<pre class="highlight">
$sortArgs[] = &$valuesArray;
unset($valuesArray); // At this moment $sortArgs array element is trunsferred 
                     // from arrray reference into array

Posted by Alexander Veremyev (alexander) on 2010-01-20T04:34:01.000+0000

Fixed

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts