Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61736 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53707 invoked from network); 25 Jul 2012 05:27:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2012 05:27:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:43986] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1C/2A-27263-FB38F005 for ; Wed, 25 Jul 2012 01:27:27 -0400 Received: by vcbgb30 with SMTP id gb30so294496vcb.29 for ; Tue, 24 Jul 2012 22:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=VwRUKo8SLsqddxx/UCewCVGCIWYr/h3+ML6wEqCYpsU=; b=COGETmb+skV0vG1ZHJI6kZl/Y/D3OrkNga46kFiHgeHY7fIvDDkzN04ia+yc/ZNULl zjohqwkhT7HAjG1k58aqkk0wsFvKE1x5YfyD4U3uDcEaNxSSv3EDLt4KjGufq8TfAKiT 2EoPlpTY5sQOw3roeABR7CLNveMkzByx8O4mlEVJzcunFAIld8yIdPjvLalrI4/JE2E9 Kgq/NX18njMfISPQWsA+4AGK6mGV0jR+DhfivQuzbmNqOssyFsVMZkQaASUWR4s4rL3m U1IQ69pFIin0MisLR+VZ4iKMarZiD+G1lpywplNCV9ng689FMiriz+qmIczH2KZYzYEl Vi/A== Received: by 10.52.176.66 with SMTP id cg2mr15129237vdc.121.1343194044877; Tue, 24 Jul 2012 22:27:24 -0700 (PDT) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.220.195.3 with HTTP; Tue, 24 Jul 2012 22:27:04 -0700 (PDT) In-Reply-To: <500F82AB.30508@sugarcrm.com> References: <933A547D13294D10A802336D74E42DFE@gmail.com> <500EEA67.8060100@sugarcrm.com> <76992170DA45492DAD9EFFEBC4F791B9@gmail.com> <500F82AB.30508@sugarcrm.com> Date: Wed, 25 Jul 2012 13:27:04 +0800 X-Google-Sender-Auth: k92lLu3caB_uALtAtN2dh9uSZ8c Message-ID: To: Stas Malyshev Cc: Reeze Xia , PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: =?UTF-8?B?UmU6IFtQSFAtREVWXSBSZTog5Zue5aSN77yaIFtQSFAtREVWXSBbUkZDXSBQcm9wb3NhbA==?= =?UTF-8?B?IG5hbWVzcGFjZSBpbXBvcnRpbmcgd2l0aCBmcm9tIHN5bnRheA==?= From: laruence@php.net (Laruence) Hi: is there any really usage? I didn't see before. I don't think every python feature is proper for PHP. PHP is not python. -1 on this RFC +1 for Stas and one more thing, BC break. there are many ORM or DB warpper libraries defines `from` method, like: $db->select()->from(); thanks On Wed, Jul 25, 2012 at 1:22 PM, Stas Malyshev wro= te: > Hi! > >> No, we can not import namespace directly for now : > > Of course you can. You just missing on what namespace import means in > PHP, it's not like Java (though a bit like Python). > >> > namespace A { >> class B {} >> } >> >> namespace { >> use A; >> >> var_dump(new B()); >> } > > use A is a no-op, just as the warnings tell you. You can just write A\B. > It's only 2 characters more. If your A is longer, then you can alias it > to something shorter. > >> and if we need alias we could=EF=BC=9A >> > // reduce >> use GlobalNamespace\SubSpace\ThirdSpace\Class1; >> use GlobalNamespace\SubSpace\ThirdSpace\Class2 as Alias2; >> use GlobalNamespace\SubSpace\ThirdSpace\ForthSpace\Class3 as Alias3; > > You could just do > use GlobalNamespace\SubSpace\ThirdSpace as Spc; > $a =3D new Spc\Class1(); > > > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > --=20 Laruence Xinchen Hui http://www.laruence.com/