PHP Classes

subtractDays

Recommend this page to a friend!

      c_date  >  All threads  >  subtractDays  >  (Un) Subscribe thread alerts  
Subject:subtractDays
Summary:$this is wrong
Messages:2
Author:Richard Munroe
Date:2006-03-16 23:15:40
Update:2006-03-20 11:15:32
 

  1. subtractDays   Reply   Report abuse  
Picture of Richard Munroe Richard Munroe - 2006-03-16 23:15:40
$this->addDays should be c_date::addDays to make things work properly.

  2. Re: subtractDays   Reply   Report abuse  
Picture of jerry mattsson jerry mattsson - 2006-03-20 11:15:32 - In reply to message 1 from Richard Munroe
Hi All ...
Regarding the Scope Resolution Operator in this context:
As I understand it, if you reference the class & function by it's name it should be ok but not nessesary from within the class itself.
$this should be refenrecable from within the class, but if used otherwise you might call the class by it's name, true.
I have not had any problems using it as it is, but I am mostly still using php4. There are a lot of changes in class behaviour in php5.