Tell me how can we determine whether a php variable is an instantiated object of a certain class?



Tell me how can we determine whether a php variable is an instantiated object of a certain class?..

Answer / Jitendra Kumar Singh

"To check if a PHP variable is an instantiated object of a certain class, you can use the instanceof keyword. For example:nnif ($var instanceof MyClass) {nt// $var is an instance of MyClassn}"

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

Explain what is the difference between $var and $$var?

1 Answers  


Which framework is best for php development?

1 Answers  


Which framework is best for php?

1 Answers  


How can you retrieve a cookie value?

1 Answers  


What is php and why we use it?

1 Answers  


PHP can be used frontend of for backend?

3 Answers   Global Logic,


How to get the number of characters in a string?

1 Answers  


How can I load data from a text file into a table?

1 Answers  


What is difference between base_url and site_url?

1 Answers  


What is in php 7?

1 Answers  


Is array a key php?

1 Answers  


What is $this in php?

1 Answers  


Categories