Examveda

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

A. .

B. *

C. ->

D. @

Answer: Option C

Solution (By Examveda Team)

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.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous