dagfinn | 25 August, 2005 22:56
Having immersed himself in some hideously coded PHP application, Alan Knowles lists six deadly PHP sins in a recent and very illuminating blog entry.
Maybe it just wasn't present in that particular example; for whatever reason, he didn't mention my particular favorite: the script include.
In PHP, it's possible to use an include file that only contains PHP code and just executes the code at the point where it's included. Typically, the include file uses global variables that are set in the including file.
This resembles a function call, but it's less explicit and harder to re-use.
In fact, global variables can hide deep inside a nested set of included files and be re-used in another file at another level of deep nesting. That can make it all but impossible to track down where a variable originates.
| « | January 2009 | » | ||||
|---|---|---|---|---|---|---|
| Su | Mo | Tu | We | Th | Fr | Sa |
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |