Re: [Operators overloading] PHP 5.1
| From: | Stanislav Malyshev | Date: | Thu, 03 Feb 2005 19:28:54 +0000 |
| Subject: | Re: [Operators overloading] PHP 5.1 | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-14587@lists.php.net to get a copy of this message | ||
PJ>>$b->a++; gives tmp = a; tmp = tmp+1; b->a = tmp;
PJ>>
PJ>>In my example (a date object, day being 31), at this I do not know
PJ>>if one is assigning 32 to the property or if it's the result of
PJ>>incrementation (or decrementation from 1 to 0).
That's why one should use $date->NextDay() and $date->PreviousDay() and
neither ++, nor --, nor manipulating properties directly :)
--
Stanislav Malyshev, Zend Products Engineer
stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115