<?php class Foo { public function __toString() { return '42'; } public function asInt(): int { return $this; } } var_dump((new Foo)->asInt());
You have javascript disabled. You will not be able to edit any code.