Detect automatic type casting
class Hello { public function randomize(): self { /* ... */return $this; } public function __toString() { return 'Hi'; } } echo (new Hello())->randomize(); // <-- Deprecated __toString call