PHP Classes

Undefined offset: -1 Does not work with func with '('

Recommend this page to a friend!

      Eval Math  >  All threads  >  Undefined offset: -1 Does not work...  >  (Un) Subscribe thread alerts  
Subject:Undefined offset: -1 Does not work...
Summary:Package rating comment
Messages:2
Author:Sasha
Date:2013-11-29 12:39:41
Update:2014-02-24 12:52:29
 

Sasha rated this package as follows:

Utility: Insufficient
Consistency: Good
Examples: Sufficient

  1. Undefined offset: -1 Does not work...   Reply   Report abuse  
Picture of Sasha Sasha - 2013-11-29 12:39:41
Undefined offset: -1
Does not work with func with '('

  2. Re: Undefined offset: -1 Does not work...   Reply   Report abuse  
Picture of Jaguar Jaguar - 2014-02-24 12:52:29 - In reply to message 1 from Sasha
Hello,

I think you can find more recent versions of evalmath, in particular a version corrected by Zack Bloom in 2007.

For the undefined offset error, replace the last function by :

function last($n=1)
{
$c = $this->count - $n;
if (($c >= 0) and ($c < sizeof($this->stack))) // Test rajouté par Thomas pour éviter les erreurs "Undefined offset".
return $this->stack[$this->count - $n];
else
return '';
}

Thomas