array indexes
Literal array indexes should be defined as $config['snafu'] instead of $config[snafu]. $config[snafu] will generate an undefined constant warning and could clash with constants that are already defined if they happened to be the same. I know that this isn't a big deal, maybe just a matter of consistency in the code.
- The Beatles
- Fear me for I am root
- Posts: 6285
- Joined: Tue May 24, 2005 8:12 pm
- The Beatles
- Fear me for I am root
- Posts: 6285
- Joined: Tue May 24, 2005 8:12 pm
Right. After setting the error reporting to E_ALL & E_NOTICE, one of the notices I saw was:
undefined constant troop - assumed 'troop' in f:\apache\htdocs\prom2\conf-proc.php on line 55
Line 55 of conf-proc.php:
foreach($config[troop] as $num => $mktcost) {
Should read:
foreach($config['troop'] as $num => $mktcost) {
Like I said, not the biggest deal in the world, but if you have hundreds of instances and large userbase, then the additional overhead for php could become an issue I suppose.
undefined constant troop - assumed 'troop' in f:\apache\htdocs\prom2\conf-proc.php on line 55
Line 55 of conf-proc.php:
foreach($config[troop] as $num => $mktcost) {
Should read:
foreach($config['troop'] as $num => $mktcost) {
Like I said, not the biggest deal in the world, but if you have hundreds of instances and large userbase, then the additional overhead for php could become an issue I suppose.
- The Beatles
- Fear me for I am root
- Posts: 6285
- Joined: Tue May 24, 2005 8:12 pm
Oh, I see what you mean. Nah, it's barely any overhead for PHP. One way it has to declare the constant, the other way it declares it implicitly, makes one if-statement to see if it should print a warning, and silently declares it. No overhead. Of course, I haven't looked at the code and am only assuming.
The reason, btw, is that Promisance was written with horrible coding style and we're still kind of burdened down by that. In our own code we mostly do use quotes.
The reason, btw, is that Promisance was written with horrible coding style and we're still kind of burdened down by that. In our own code we mostly do use quotes.
:wq
-
Members connected in real time
