Re: [PHP] Methods for instatiating an object

2004-05-12 Thread Jordi Canals
Rudy Metzger wrote: It is as you say. The problem is normally negligible, but makes a big difference if there is alot done in the constructor of the object (e.g. scanning a huge file for certain strings). Then this will slow things down. This however is solved in PHP5. Thanks to all for your answer

Re: [PHP] Methods for instatiating an object

2004-05-12 Thread Rudy Metzger
On Wed, 2004-05-12 at 12:41, Jordi Canals wrote: > Hi all, > > It is not a big issue, but that is something that I never had clear. > I've been looking at the manual and found no answer, so I will ask with > an example: > > When instantiating an object, I could do it in two different ways: > >

Re: [PHP] Methods for instatiating an object

2004-05-12 Thread Mark Constable
On Wed, 12 May 2004 08:41 pm, Jordi Canals wrote: > A)$object = new MyClass; > B)$object =& new MyClass; > 1) In case A, PHP creates a new object and returns a Copy of this new > object, so really I will have the object two instances for the object in > memory ... > > 2) In case B, PHP cre

[PHP] Methods for instatiating an object

2004-05-12 Thread Jordi Canals
Hi all, It is not a big issue, but that is something that I never had clear. I've been looking at the manual and found no answer, so I will ask with an example: When instantiating an object, I could do it in two different ways: A) $object = new MyClass; B) $object =& new MyClass; I c