This code:
<?php declare(strict_types = 1);
enum P
{
case A;
case B;
}
$p = P::A;
$s = "{$p}";
Above, the last line is detected by PHPStan as:
Part $p (P::A) of encapsed string cannot be cast to string.
PHP Tools does currently not detect it.
A similar example:
<?php declare(strict_types = 1);
class Test4
{
}
$d = new Test4();
$s = "{$d}";
Again, PHPStan detects this:
Part $d (Test4) of encapsed string cannot be cast to string.
My suggestion
Please also notify me when misusing something inside a string interpolation that is not allowed.