Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34191 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50143 invoked by uid 1010); 21 Dec 2007 02:46:48 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 50128 invoked from network); 21 Dec 2007 02:46:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Dec 2007 02:46:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=malterisio777@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=malterisio777@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.162.225 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: malterisio777@gmail.com X-Host-Fingerprint: 64.233.162.225 nz-out-0506.google.com Received: from [64.233.162.225] ([64.233.162.225:54711] helo=nz-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 69/30-46841-3192B674 for ; Thu, 20 Dec 2007 21:46:47 -0500 Received: by nz-out-0506.google.com with SMTP id x7so90970nzc.38 for ; Thu, 20 Dec 2007 18:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=J0yIKfzBs+TeG4OivW44An1CdfjDnqfddXIYdxi0Tlg=; b=s9mbeYWG6ETazUTSlq7gX5kcSjcWii1X85wYk6lEjHYYhYO+e3XxZQHIz2VXX8mJ0uPDTiVg5OEC/tPBm6xIfIRWFrsq3pOqfU/wfCXsxlnk37cxFdrUiQhljCLg/s/RjKKI1zegyby7OOdGz+eI2VgwLsp6AvoJNL6vGfKZhcM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=MgO+WX6PYJHuuwomBD1lBwUkq+L4302VTQsM4+CfZx6dxX0sbOAXgZ1sH2G+F1naB3yUe3upNyr1zgkxSDPBaQYBREFsq/iNTDLjE3epO2EFn52IeLT9arIxZtG1UsL1kvrqS4f0kMA8ECMrn7T3iSFsBKnGymdweR5I0aX63J8= Received: by 10.142.128.6 with SMTP id a6mr463453wfd.74.1198205196306; Thu, 20 Dec 2007 18:46:36 -0800 (PST) Received: by 10.142.157.9 with HTTP; Thu, 20 Dec 2007 18:46:36 -0800 (PST) Message-ID: <52dbac0f0712201846s470cadddx1fe63414a024db4a@mail.gmail.com> Date: Thu, 20 Dec 2007 23:46:36 -0300 To: "Greg Beaver" Cc: "PHP Developers Mailing List" In-Reply-To: <52dbac0f0712201509h426c1208i7c035793653aa711@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_23599_22085967.1198205196318" References: <52dbac0f0712201120x2b8cd45dne6097fe4c57ee281@mail.gmail.com> <476AE52F.9090607@php.net> <52dbac0f0712201509h426c1208i7c035793653aa711@mail.gmail.com> Subject: Re: Question on "use" behavior From: malterisio777@gmail.com ("Martin Alterisio") ------=_Part_23599_22085967.1198205196318 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 2007/12/20, Martin Alterisio : > > 2007/12/20, Greg Beaver : > > > > Martin Alterisio wrote: > > > Consider the following code: > > > > > > test.php: > > > > > include 'foo.php'; > > > use test::foo; > > > foo(); > > > ?> > > > > > > foo.php: > > > > > namespace test; > > > function foo() { } > > > ?> > > > > > > Is it expected behavior that the scripts ends in: > > > Fatal error: Call to undefined function foo() > > > ? > > > > Hi Martin, > > > > No. This is a bug, I was alluding to it in an earlier email, but you > > know how time eats up one's life, so I haven't reported it and would > > grateful if someone would (or Dmitry/Stas would just know why it is > > broken and fix it :) > > > > Greg > > > > Thank you. Sorry I didn't read your mail about this bug. I'll look into it > a bit more and post a bug report. > > Have you seen my post scriptum in the first mail about benchmarks? Any > idea of what I could use to test the performance of the unsolved name > resolutions that are pushed into the executer? I expect there won't be any > considerable performance penalty but just want to be completely sure. Please, review the following patch against 5.3: http://martinalterisio.com.ar/php5.3/use.function.patch It should fix the use statement behavior so that aliases for namespaced functions into global scope are recognized. The example code in the first mail shouldn't fail and call test::foo(). I've tried some variations and run the tests without finding any problem, but please check again if you can. If nothing comes out, I'll post it in a bug report asap. Best Regards, Martin Alterisio ------=_Part_23599_22085967.1198205196318--