Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67098 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68536 invoked from network); 19 Apr 2013 06:19:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Apr 2013 06:19:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.67 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.67 smtp67.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.67] ([108.166.43.67:52810] helo=smtp67.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/50-00022-BF1E0715 for ; Fri, 19 Apr 2013 02:19:40 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 24E93148085; Fri, 19 Apr 2013 02:19:37 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp1.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id C47EA148075; Fri, 19 Apr 2013 02:19:36 -0400 (EDT) Message-ID: <5170E1F8.9060203@sugarcrm.com> Date: Thu, 18 Apr 2013 23:19:36 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Igor Wiedler CC: "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Importing namespaced functions From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > One of the shortcomings of namespaced functions in PHP is that it is > not possible to import them as you can do with classes and > namespaces. For code that is not in the same namespace as the > function, you must always reference at least one part of the > namespace in order to call it. What's wrong with referencing one part of it? It can be as short as two characters, and an an added bonus you won't suddenly have your strlen overridden by somebody without you knowing it. Functions live in global space, and there's a real lot of them, that's why importing them wasn't considered a good idea - it's going back to the same problem we were escaping with namespaces. Saving two keystrokes while sacrificing clarity is usually not the best idea. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227