Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What does the spaceship operator () return?

  1. A -1, 0 or 1 depending on whether the left is less than, equal to or greater than the right
  2. B true or false
  3. C The larger of two values
  4. D The difference between two numbers
Answer

-1, 0 or 1 depending on whether the left is less than, equal to or greater than the right

It was introduced in PHP 7 and is designed for use in usort and similar comparison callbacks.

All Php MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as