<?php class Foo { public function __toString(): string { return "foo@example.com"; } } $val = new Foo(); var_dump(filter_var($val, FILTER_VALIDATE_EMAIL)); var_dump($val);
You have javascript disabled. You will not be able to edit any code.