PHP Multiple choices

Total available count: 47
Subject - PHP Frameworks
Subsubject - PHP

How can we test if two objects are referring to the same instance of the same class in PHP?







The identity operator (===) allows for a much stricter comparison between the given variables or values. This operator returns true if both variable contains same information and same data types otherwise return false.

Object variables are compared in a simple manner when using the comparison operator (==), namely: Two object instances are equal if they have the same attributes and values (values are compared with ==) and are instances of the same class.

When using the identity operator (===), object variables are identical if and only if they refer to the same instance of the same class.

An example will clarify these rules.

Following is the example of object comparison:

function bool2str($bool)
  if ($bool === false) {
    return 'FALSE';
  } else {
    return 'TRUE';


Next 4 multiple choice(s)


All variables in PHP start with which symbol?


How do you write "WELCOME" in PHP?


PHP server scripts are surrounded by delimiters, which?


What does PHP stand for?