I assume this is supposed to be a
sort_custom() function for an
Array (as documented here)?
If so, the docs show the function should be
Using your function as-is seems to work for me - after making it static. However, I don't really understand what you're doing.
You seem to be trying to sort an
Array's that contain some sort of object that has
get_width() functions (such as an
Further, you're basing the sort decision on
get_width() results of the 2nd element in the array. Again, not sure of the intention here, but the above does seem to work for me (or, at least generates a modified order for my random array and does not generate the error you reported).
If the above doesn't help, perhaps a more detailed explanation, along with some more code that shows how you're setting up and calling the custom sort.