RE: [PHP] arrays, loops, vars and props

2004-03-10 Thread Chris W. Parker
Jason Davidson mailto:[EMAIL PROTECTED] on Wednesday, March 10, 2004 12:25 AM said: would the following example be faster or slower had i simply done $this-myArray[$i] = $i; class MyClass { var $myArray = array(); function MyClass() { $myTempArray = array();

Re: [PHP] arrays, loops, vars and props

2004-03-10 Thread Luis Mirabal
i would do it this way function MyClass() { $this-myArray = range(0, 99); } luis. Chris W. Parker [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Jason Davidson mailto:[EMAIL PROTECTED] on Wednesday, March 10, 2004 12:25 AM said: would the following example be faster

RE: [PHP] arrays, loops, vars and props

2004-03-10 Thread Michal Migurski
here's how i would do it (coding styles aside): function MyClass() { $limit = 100; $i = -1; while(++$i $limit) { $this-myArray[] = $i; } } Don't forget poor old range: $this-myArray = range(0, 99);

RE: [PHP] arrays, loops, vars and props

2004-03-10 Thread Chris W. Parker
Luis Mirabal mailto:[EMAIL PROTECTED] on Wednesday, March 10, 2004 12:30 PM said: i would do it this way function MyClass() { $this-myArray = range(0, 99); } guys (luis), guys (mike), let's not try to one-up each other... ... ... but i would take it a step further. :P function

RE: [PHP] arrays, loops, vars and props

2004-03-10 Thread Jason Davidson
Im fully aware of diffrent ways of doing it, my question is, in the 2 ways i mentioned, which is more efficient. Ill take the question to the internals list. Thanks for your responses. Jason Chris W. Parker [EMAIL PROTECTED] wrote: Luis Mirabal mailto:[EMAIL PROTECTED] on Wednesday,