Exam 200-710 All QuestionsBrowse all questions from this exam
Question 33

FILL BLANK -

What function can be used to determine the type of an object property?

    Correct Answer:

    The function that can be used to determine the type of an object property is `gettype()`. This function returns the type of the variable as a string. For example, if you want to determine the type of a property `someVar` of an object `$x`, you would use `gettype($x->someVar)`. The function `get_object_vars()` is used to get the properties of an object in an associative array, not to determine their types.

Discussion
nicky91294

gettype()

KirillS

Wrong! get_object_vars returns properties of the object! To find a type of a property gettype is used, e.g. gettype($x->someVar)