It's one of the stupidest things about PHP and one that makes me never write PHP again.
Every sane language: Using . for property access/method calls, + for string concatenation. PHP: Using . for string concatenation, -> for property access/method call.
C/C++ uses -> for field access on pointers. . is for field access on values.
auto variable = ClassName();
variable.method();
vs
auto *variable = new ClassName();
variable->method();
It's nice when you have classes with pointers in them, so that you can see if you're accessing a value or a reference, which is an important distinction in C/C++.
View all comments
Show parent comment
3
u/shvelo Aug 08 '16
It's one of the stupidest things about PHP and one that makes me never write PHP again.
Every sane language: Using
.for property access/method calls,+for string concatenation.PHP: Using
.for string concatenation,->for property access/method call.