I'm thinking of some of the array functions. key, each, pos, range. These are often very useful as local identifiers! I have also seen code that (ab)uses $return, $list, $array, $string. What are other PHP programmers views on this?Local identifiers only! I wouldn't use them as members or method names of a class, even less global variables.
Using php functions, reserved words as local identifiers
php;functions
The reason they bother me is not because they are reserved words within the language itself, but rather that they are too general. What does the $array contain? What is it an array of?$list, $string, $array, $key, etc are far too generic and not descriptive enough variable names to be useful. Especially when debugging someone else's code.Even in the context of local variables, having more descriptive variable names would make understanding what the code is doing much much faster.