[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-developers] i++ versus ++i
From: |
Kai Hofmann |
Subject: |
[Phpgroupware-developers] i++ versus ++i |
Date: |
Fri, 6 Feb 2004 15:32:17 +0100 |
Just for info, why it is better to use ++$i instead of $i++
source: http://www.gotw.ca/gotw/002.htm
Preincrement is more efficient than postincrement, because for postincrement
the object must increment itself and then return a temporary containing its
old value. Note that this is true even for builtins like int!
[Guideline] Prefer preincrement, avoid postincrement.
Have a happy weekend.
Kai/PowerStat
--
***** Open Source und Linux im professionellen Einsatz *****
** komplexe Mailserver, Groupware, Office: sprechen Sie uns an **
Dipl.-Inform. Kai Hofmann Team Softwarelösungen
pro|business AG, EXPO Plaza 1 (Deutscher Pavillon), 30539 Hannover
E-Mail: address@hidden, Tel.: 0511/60066-332, Fax: -355
WWW: http://www.probusiness.de/
- [Phpgroupware-developers] i++ versus ++i,
Kai Hofmann <=