PHP Classes

Error in line 32

Recommend this page to a friend!

      bkTree  >  All threads  >  Error in line 32  >  (Un) Subscribe thread alerts  
Subject:Error in line 32
Summary:Forgotten $-sign
Messages:3
Author:Jethro
Date:2012-04-04 16:29:29
Update:2012-04-05 18:10:26
 

  1. Error in line 32   Reply   Report abuse  
Picture of Jethro Jethro - 2012-04-04 16:29:29
There is an error on line 32:
PHP Notice: Use of undefined constant l - assumed 'l' in class.bkTree.php on line 32

I assume that:
for($i=$d-$l; $i<=$d+l; $i++)
needs to be changed to:
for($i=$d-$l; $i<=$d+$l; $i++)

  2. Re: Error in line 32   Reply   Report abuse  
Picture of Brian Brian - 2012-04-04 17:00:00 - In reply to message 1 from Jethro
Thanks for catching this Jethro, the typo was not in my local copy so I haven't caught this in implementations. Fixing it now.

  3. Re: Error in line 32   Reply   Report abuse  
Picture of Jethro Jethro - 2012-04-05 18:10:26 - In reply to message 2 from Brian
You're welcome.
And while I'm looking at the code I noticed 2 more small things:

Line 22:
if ($this->members[$d]) $this->members[$d]->addTerm($t);
'PHP Notice: Undefined offset'
I changed it to:
if (isset($this->members[$d])) $this->members[$d]->addTerm($t);

And line 31 I changed to:
if (!$d) $d = $cd;