Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50909 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90110 invoked from network); 8 Dec 2010 01:12:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2010 01:12:09 -0000 Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:38107] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/60-21318-56BDEFC4 for ; Tue, 07 Dec 2010 20:12:07 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 61CB870003FC for ; Wed, 8 Dec 2010 01:12:02 +0000 (WET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id 5Txe8DpMoP7f for ; Wed, 8 Dec 2010 01:12:02 +0000 (WET) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 25E5E70003F2 for ; Wed, 8 Dec 2010 01:12:02 +0000 (WET) Received: from cataphract-old.dulce.lo.geleia.net (cataphract-old.dulce.lo.geleia.net [IPv6:2001:470:94a2:2:9978:6e7:759:40ee]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id 2429B2006C47 for ; Wed, 8 Dec 2010 01:12:00 +0000 (WET) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: internals@lists.php.net References: Date: Wed, 08 Dec 2010 01:11:43 -0000 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_IST?= Message-ID: In-Reply-To: User-Agent: Opera Mail/11.00 (Win32) Subject: Re: [PHP-DEV] RE : Re: [PHP-DEV] [PATCH] Add option to disable POST data processing From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Wed, 08 Dec 2010 00:45:56 -0000, Tjerk Meesters wrote: > Don't have much knowledge about the internal workings of the engine, but > I'm wondering if it's possible to apply "lazy loading" to the $_POST > variable, so that processing only happens if and when it's requested. > > That way you wouldn't need the ini setting. In most cases, processing (=parsing) of the POST data already only occurs when $_POST is requested; however, previously the data was already entirely copied to two or three memory locations. If you mean making it so that the data is only *read and processed* when $_POST is requested, I suppose that would be possible, but I think it would require significant code/architectural changes to PHP and to the sapis. It would also raise other problems, including backwards compatibility breaks, if we wanted the change to bring any benefit. For instance, current scripts can, in POST requests, read any number of times from php://input or $HTTP_RAW_POST_DATA (to simplify, let's say we even let go $HTTP_RAW_POST_DATA). For this to be possible, you would have to have the data in memory because you're reading from php://input the first time, you can't know if it will be read a second time, so you either break BC or keep everything in memory just in case there's a second read -- and then you're where you started. -- Gustavo Lopes