It seems that in the PHP 7 version for Scalar Objects, it is now possible to do something like "str"->toUpper(). It is very nice, but I find that string interpolation wont work. So the code below will fail:
$filepath = "{$path}/{$class}.php"->toLower();
Is this the expected behavior, or is it a glitch? Just wondering.
This is a bug in PHP (or at least an oversight). I've reported it upstream as https://bugs.php.net/bug.php?id=72981. For now a workaround is ("{$path}/{$class}.php")->toLower();.
It seems that in the PHP 7 version for Scalar Objects, it is now possible to do something like "str"->toUpper(). It is very nice, but I find that string interpolation wont work. So the code below will fail:
Is this the expected behavior, or is it a glitch? Just wondering.