mirror of
https://github.com/danog/psalm.git
synced 2024-12-03 10:07:52 +01:00
16 lines
259 B
Markdown
16 lines
259 B
Markdown
|
# ImplicitToStringCast
|
||
|
|
||
|
Emitted when implicitly converting an object with a `__toString` method to a string
|
||
|
|
||
|
```php
|
||
|
class A {
|
||
|
public function __toString() {
|
||
|
return "foo";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function takesString(string $s) : void {}
|
||
|
|
||
|
takesString(new A);
|
||
|
```
|