Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39380 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8819 invoked from network); 27 Jul 2008 14:24:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jul 2008 14:24:22 -0000 Authentication-Results: pb1.pair.com header.from=arnaud.lb@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=arnaud.lb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.134.186 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: arnaud.lb@gmail.com X-Host-Fingerprint: 209.85.134.186 mu-out-0910.google.com Received: from [209.85.134.186] ([209.85.134.186:6383] helo=mu-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 86/96-02589-6158C884 for ; Sun, 27 Jul 2008 10:24:22 -0400 Received: by mu-out-0910.google.com with SMTP id i2so3044875mue.3 for ; Sun, 27 Jul 2008 07:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=q7HdYPfbgoCMEop16x56E38OzIz9LnnGQ9cvNZ5YDuQ=; b=gw12Q3+fb+uXMnQkepzusYitxRxjySVqU1d+Yvt6sSCCv5AoWgh/ItUsW9FINMDAWB 2/0p4KNdJK2YXjh2MHAWH/uavb7E/Q66g8L6WJ9LTjkNX4rLtsnEVqU74hhj3IrsPlRn 6rHuIHqwTkuRjYkeuSOmUnEH29wczw6nYR/cY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=xWpF201Ki5fdKnluieWvFBjwMHfNEltWPsGd9FGpb7bgB9YMjlB7P6IOTpWpjnl3Cd mRxa5jfcmBRPUyUnIhwzTfgBAnDibxBZor0MiymUyaF0Q9odUpA90MocyRbDB1G6QXHP 7Kq5hUWpojWkNjCmJz6jwPuZhWGxPYofP2t6o= Received: by 10.103.249.7 with SMTP id b7mr2359356mus.2.1217168659405; Sun, 27 Jul 2008 07:24:19 -0700 (PDT) Received: from 207-177-41-213.getmyip.com ( [213.41.177.207]) by mx.google.com with ESMTPS id y6sm81530250mug.15.2008.07.27.07.24.17 (version=SSLv3 cipher=RC4-MD5); Sun, 27 Jul 2008 07:24:18 -0700 (PDT) To: internals@lists.php.net Date: Sun, 27 Jul 2008 16:22:50 +0200 User-Agent: KMail/1.9.9 Cc: "Matt Wilmas" , "Dmitry Stogov" , "Andi Gutmans" , "Stanislav Malyshev" References: <00ea01c8a160$2edd8160$0201a8c0@pc1> <488C5464.1030706@zend.com> <003c01c8efed$98d23620$0201a8c0@pc1> In-Reply-To: <003c01c8efed$98d23620$0201a8c0@pc1> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200807271622.50333.arnaud.lb@gmail.com> Subject: Re: [PHP-DEV] New optimization idea; was: No runtime fetching of built-in global constants From: arnaud.lb@gmail.com ("Arnaud Le Blanc") Hi, On Sunday 27 July 2008 15:35:11 Matt Wilmas wrote: > > Sorry, but now I'm the one who's confused here, since I have no idea what > I'm supposed to look into exactly. :-/ I know about shebang lines, and I > know there's a check in the scanner now to skip over it (must have been > somewhere else with flex...). PHP itself doesn't "use" the shebang, does > it? I don't have much knowledge of *nix system stuff, but I thought the > shebang is for the OS to use when asked to run an executable script... The shebang line is used by the operating system to know which interpreter to use to execute the file. In most cases this does not cause any problem to the interpretor as lines starting with # are comments in many languages, but in PHP it's not a comment as long as it's not enclosed with , so PHP must check if there is a shebang line and skip it. > > So I don't understand what could be changed in the scanner to save the open > syscall -- since if the scanner is called, the file has already been opened, > right? Again, sorry, but I'll need more explanation. :-) Actually the CGI SAPI opens the file, seeks after the shebang line, and then passes the opened file descriptor to the scanner. I see two solutions for that: Make the scanner completely bypass the shebang line if cgi.check_shebang_line==1 Or let the executor decide wether to output the shebang or not by enclosing it in a "SHEBANG" opcode for example. Regards, Arnaud