Why doesn't phpstorm auto change a "." to a "->"?????

This is basic auto completion... php doesn't have a . sintax, only ->
Why should I have to waste sooooo much time writing ->, when phpstorm can just change my .'s to ->'s....
I feel sad...

4 comments

Maybe because "." actually has special meaning in PHP (concatenating strings)?

P.S.
You can use custom Live Template if you think this will be easier: to change [dot][Space] to -> . Not ideal, but definitely faster than typing ->

0

But phpstorm knows it's an object, not a string. Just like C++ editors knows when a var is a pointer or not, and uses . o r-> accordinly.
It's just sooo basic.

Edit: nice tip about live templates, not the best solution, but one nevertheless. I'm using just a "." as abbreviation, then [tab] to change it to a  "->". I'm not using [space] because when I concat strings I usually leave a space, like: "concat" . "this" . "string"

0

Issue Tracker where you can leave your Feature Request is located here: http://youtrack.jetbrains.com/issues/WI

P.S.

class First
{
    function __toString()
    {
        return "Meow!";
    }
}

$a = new First();
$b = new First();
$z = $a.$b;
echo $z;

0

That should be an exception, not the rule. Esp. since it's not the most typed.

0

Please sign in to leave a comment.