mirror of
https://github.com/danog/psalm.git
synced 2024-12-04 10:38:49 +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);
|
|
```
|