SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2004
    Location
    oxon
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question usort has stopped working?

    Hi,

    usort($subjects,"return -1");

    This line in my code was working fine until today, but it's now giving me the error message,

    Warning: usort(): Invalid comparison function.

    Does anyone know why? Thanks

  2. #2
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uh.. the second parameter is supposed to be a callback function, return shouldn't work as far as I can tell.

    Other possibilities: $subjects could no longer be an array - have you confirmed this? Perhaps there's been a PHP upgrade on your server and now something's not supported?

  3. #3
    SitePoint Member
    Join Date
    Oct 2004
    Location
    oxon
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, thanks,

    Well seeing as I haven't changed this code for months and it's only stopped working today, I guessed it must be a PHP upgrade or something. I just checked and PHP version is currently 4.3.9.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •