stressed out
stressed out

Reputation: 552

Is there a difference between self and Self in PHP?

I just noticed that when I write self:: in Microsoft Visual Studio Code it becomes dark blue but when I type Self:: it becomes seagreen. Is there a difference between the two?

Upvotes: 0

Views: 373

Answers (1)

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324620

Functionally no, keywords are case-insensitive so True, Array, FaLsE, clASS lol {...} are all fine.

But Visual Studio is probably seeing \b[A-Z_]\w+ as a class name, hence the different syntax highlighting.

Ideally, all keywords should be lowercase anyway, so stick with that if you can.

Upvotes: 1

Related Questions