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

Which is an appropriate use of a static method?

  1. A A factory or utility function that needs no instance state
  2. B Storing per-request user data
  3. C Managing database connections per user
  4. D Holding form state
Answer

A factory or utility function that needs no instance state

Static state is shared globally, which makes code hard to test and dangerous in long-running processes. Use it sparingly.

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