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 declare(strict_types=1) do?

  1. A Enables type coercion
  2. B Enforces exact type matching for scalar type declarations in that file
  3. C Disables all type checking
  4. D Enables strict error reporting
Answer

Enforces exact type matching for scalar type declarations in that file

Without it, passing the string "5" to an int parameter is silently coerced. With it, a TypeError is thrown.

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