Tell me how comparison of objects is done in php5?



Tell me how comparison of objects is done in php5?..

Answer / Pavitra Pratap Singh Deora

In PHP, when comparing objects, the `==` operator performs a type comparison (type juggling), while the `===` operator checks for both type and value equality. To compare objects strictly by their value, you can use the `is_object()` function with `get_class()`: `if ($obj1 instanceof get_class($obj2)) { ... }`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

What are default session time and path?

1 Answers  


What type of inheritance that PHP supports?

15 Answers   Webwing Technologies,


What are the characteristics of php?

1 Answers  


What are the features of php?

1 Answers  


does current version of mysql (myisam) supports foreign keys ?

2 Answers  


Explain Parsing and Execution in PHP? Where PHP Engine Return errors?

3 Answers   CMC,


What is data structure in php?

1 Answers  


What is the difference between file_get_contents() and file_put_contents() in php?

1 Answers  


What is "print" in php?

1 Answers  


How to execute a function in php?

1 Answers  


What is the tags in PHP is not a valid way to begin and end a PHP code block?

1 Answers  


I have two radio button, i click one radio button display one dropdown box, one text field. and then click another radio button display one text field.so any one give me good idea plz.....i used <div id="" style=display:none> but not work..

4 Answers  


Categories