Re: cvs: pear /Log_Parser Parser.php
| From: | Mirco 'meebey' Bauer | Date: | Wed, 24 Sep 2003 19:07:45 +0000 |
| Subject: | Re: cvs: pear /Log_Parser Parser.php | ||
| References: | 1 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-13065@lists.php.net to get a copy of this message | ||
On Wed, 2003-09-24 at 17:34, Xavier Noguer Gallego wrote:
> - for ($i = 1; $i <= count($lineDef); $i++) {
> - $this->_indexes[$lineName][$i] =
> $config_array[$lineName][$i]['name'];
> - $this->regex[$lineName] .=
> $config_array[$lineName][$i]['pattern'];
> + for ($i = 1; $i <= (count($lineDef)); $i++) {
> + @$this->_indexes[$lineName][$i] =
> @$config_array[$lineName][$i]['name'];
> + @$this->regex[$lineName] .=
> @$config_array[$lineName][$i]['pattern'];
putting on everything a "@" fixes your problems?
if you wan't to be sure that the array index exist, _use_ isset() not @
and putting a function call into the for condition is not good, the
function (count()) is called on every cycle, if the value doesn't
change, like in this case ($lineDef) it should call count() once and
store it into a variable and then use the variable instead the
functioncall....
This is just QA