Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33969 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75806 invoked by uid 1010); 12 Dec 2007 13:05:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 75791 invoked from network); 12 Dec 2007 13:05:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2007 13:05:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:59403] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/BE-38526-29CDF574 for ; Wed, 12 Dec 2007 08:05:26 -0500 Received: (qmail 14204 invoked by uid 507); 12 Dec 2007 13:05:18 -0000 Received: from unknown (HELO ?192.168.1.102?) (postmaster%schlueters.de@82.135.11.142) by mail4.netbeat.de with ESMTPA; 12 Dec 2007 13:05:18 -0000 To: Gregory Beaver Cc: Ken Stanley , internals Mailing List In-Reply-To: <475F64B5.7010100@chiaraquartet.net> References: <475F1984.603@chiaraquartet.net> <475F64B5.7010100@chiaraquartet.net> Content-Type: text/plain Date: Wed, 12 Dec 2007 14:05:06 +0100 Message-ID: <1197464706.12523.14.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.12.2 (2.12.2-2.fc8) Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] namespace improvements to be committed very soon - final review From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Tue, 2007-12-11 at 22:33 -0600, Gregory Beaver wrote: > Any brackets adds another set of shift/reduce to the parser, regardless > of how the syntax of the language is defined. That's not all with that syntax. Leads to a delayed declaration which is done at run-time, not at compile-time - this might have bigger performance issues than just the shift/reduce in the parser - especially with opcode caches. $ php53 -dvld.active=1 -dvld.execute=0 -r '{ class foo { }}' Branch analysis from position: 0 Return found filename: Command line code function name: (null) number of ops: 5 compiled vars: none line # op fetch ext return operands ------------------------------------------------------------------------------- 1 0 NOP 1 EXT_STMT 2 ZEND_DECLARE_CLASS null '%00fooCommand+line+code0x998387c', 'foo' 3 RETURN null 4* ZEND_HANDLE_EXCEPTION Class foo: [no user functions] vs. $ php53 -dvld.active=1 -dvld.execute=0 -r 'class foo { }'Branch analysis from position: 0 Return found filename: Command line code function name: (null) number of ops: 4 compiled vars: none line # op fetch ext return operands ------------------------------------------------------------------------------- 1 0 EXT_STMT 1 NOP 2 RETURN null 3* ZEND_HANDLE_EXCEPTION johannes