views:

334

answers:

1

Hi, the following code produces the error in the title. I've tried to google it, but all I got were pages who got the same error (and not an explanation thereof). This isn't really a problem since it's actually working and cancelling the error out with the @ works out just fine. Though I'm still wondering why I haven't been able to execute array_multisort just once without getting this error.

public function getMostRelevant(){

  list($occurrences, $keywords) = $this->occurr_keyw_array;


  array_multisort($occurrences, SORT_DESC, SORT_NUMERIC,
      $keywords);

  $return_array = array(
         array($occurrences[0], $keywords[0]),
         array($occurrences[1], $keywords[1]),
         array($occurrences[2], $keywords[2])
         );

  return $return_array;

 }
A: 

Make sure that $this->occurr_keyw_array and then $occurrences contain what you expect them to contain.

Kamil Szot
this is $this->occurr_keyw_array:Array ( [0] => Array ( [0] => 5 [1] => 0 [2] => 0 [3] => 0 [4] => 99 ) [1] => Array ( [0] => lung [1] => is [2] => most [3] => important [4] => organ ) )
johnny
does $occurences really contain Array ( [0] => 5 [1] => 0 [2] => 0 [3] => 0 [4] => 99 ) after list($occurren.... line?
Kamil Szot