ExamVeda
Login
Home
This question belongs to MySQL MySQL Miscellaneous
MySQL Miscellaneous
?

In PHP, which operator is used to access property of an object?

Answer & Solution
Correct Answer: Option C
This question asks about how you access parts of an object in PHP. Think of an object like a box with different things inside.
To get something out of the box, you need the right tool.
The correct answer is Option C: ->
The -> operator is like the key to open the box and get the specific item you want.
For example, to get the "name" property from an object called "myObject," you'd write:
$myObject->name

The other options are not used for accessing object properties:
* Option A: . is used for string concatenation.
* Option B: * is used for multiplication.
* Option D: @ is used for error suppression.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.