Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41201 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17015 invoked from network); 17 Oct 2008 08:07:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Oct 2008 08:07:51 -0000 X-Host-Fingerprint: 130.149.254.149 messe-254-149.zrz.TU-Berlin.DE Received: from [130.149.254.149] ([130.149.254.149:17337] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/7F-12818-5D748F84 for ; Fri, 17 Oct 2008 04:07:50 -0400 Message-ID: <67.7F.12818.5D748F84@pb1.pair.com> To: internals@lists.php.net Date: Fri, 17 Oct 2008 10:07:46 +0200 User-Agent: Thunderbird 2.0.0.17 (Macintosh/20080914) MIME-Version: 1.0 References: <48F653FF.5010106@chiaraquartet.net> <48F75FA1.7020505@zend.com> <48F7AD03.1050009@chiaraquartet.net> <11c607a60810161547q71f86dc6rb2dad98d17eebf56@mail.gmail.com> In-Reply-To: <11c607a60810161547q71f86dc6rb2dad98d17eebf56@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 130.149.254.149 Subject: Re: [PHP-DEV] my last attempt at sanity with namespaces From: karsten@typo3.org (Karsten Dambekalns) Hi. Sorry for yet another OT post in this thread. Josh Davis wrote: > I have a question about 3. Where in a script can you use the "use" > statement? Could it be used inside conditionals? For example, > > if ($testing) { > use class testing::PDO; > } else { > use class ::PDO; > } I hope this is a badly chosen example, as code should never behave seperately when under test as compared to production. Use dependency injection to feed a mock object, but don't do this. Regards, Karsten