Re: Repeated New Object Requests

From: Date: Mon, 13 Aug 2012 14:57:00 +0000
Subject: Re: Repeated New Object Requests
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-318682@lists.php.net to get a copy of this message
On 12-08-10 02:24 PM, Al wrote:
Off the subject a bit. What does PHP do with repeated new classes, e.g. $mime = new Mail_mime Are they simply ignored or are additional new instances created. PHP won't let you duplicate function names.
Hi Al, New isn't defining a class, it's a request for an instance of a defined class. Thus it will create a new instance over and over again for every time the new request is made. The equivalent to "won't let you duplicate function names" is "won't let you duplicate class names". Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized.

« previous php.general (#318682) next »