On Mon, Jul 12, 2021 at 8:01 PM Mike Schinkel <[email protected]> wrote:
> Additionally in Go a type assertion can return a second value which is
> boolean telling if the type assertion succeeded. Not having this would
> effectively moot the benefit to a type assertion if you had to wrap with
> try{}catch{} in case it failed.
>
Not necessarily:
if ($obj instanceof MyClass) {
// We know its type here
} else {
// Try something else
}
--
Best regards,
Max Semenik
