Re: Constant Parameters
| From: | Sean Coates | Date: | Fri, 02 Mar 2007 21:25:44 +0000 |
| Subject: | Re: Constant Parameters | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-28210@lists.php.net to get a copy of this message | ||
> $db = new DBConnection($properties);
> // Notice, still not connected to DB
> $third_party_obj->foo($db);
> $db->connect();
In the requested feature, the "protection" is in the wrong hands (that
of the third party object).
You're much better off changing your call to:
$third_party_obj->foo(clone $db);
S