is_a() Versus Instanceof

no-email (Damien Seguy), Damien Seguy
Fri, 17 Feb 2023 00:00:00 +0000

is_a() and instanceof are the same feature: check if an object is of a specific class. Yet, they do things in different ways.
Using the ::class operator is safe in both cases.
Using a name is a class name for instanceof, while it is a constant name with is_a(). This may lead to confusion.