Information
- Language: PHP
- Plugins: none
Description
In PHP there are keywords, which can't be used as class names or variable names, but they can be used as method names.
For example, match and foreach are keywords, but they can be used as $var->match() and $var->forEach() methods.
For example GitHub and PhpStorm colors this code corectly.
Code snippet
Test page
The code being highlighted incorrectly.
$variable->foreach(); // this "foreach" is a method
$variable->method(); // this is also a method
foreach ($list as $value) { // this "foreach" is a keyword
}