Skip to content

Latest commit

History

History
15 lines (12 loc) 路 502 Bytes

File metadata and controls

15 lines (12 loc) 路 502 Bytes

What is the best way to ensure that a user-defined function is always passed an object as its single parameter?

  • A) function myfunction(stdClass $a)
  • B) function myfunciton($a = stdClass)
  • C) Use is_object() within the function
  • D) There is no way to ensure the parameter will be an object
Answer

Answer: A