Question from the PHP - Fundamentals test

Compare two values with === operator in PHP

Medium

What is the output of the following code ?

function are_equal($a, $b) {
	if ($a === $b) {
		echo "$a is identical to $b\n";
	}
}
are_equal(1, 1);
are_equal(0.0, 0);
are_equal("a", "a");
are_equal(array(), array());
Author: ThéoStatus: PublishedQuestion passed 96 times
Edit
0
Community Evaluations
developer avatar
nicolas
07/03/2024
Il y aura un message de ce type avec le test sur les array, que l'on soit en php 7 ou 8 : "Warning: Array to string conversion in ....."
developer avatar
Auteur anonyme
15/03/2024
Tu penses que la réponse est fausse ?