Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74434 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16768 invoked from network); 22 May 2014 21:01:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 May 2014 21:01:53 -0000 Authentication-Results: pb1.pair.com header.from=garyamort@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=garyamort@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.180 as permitted sender) X-PHP-List-Original-Sender: garyamort@gmail.com X-Host-Fingerprint: 209.85.216.180 mail-qc0-f180.google.com Received: from [209.85.216.180] ([209.85.216.180:47795] helo=mail-qc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/E6-63132-CB56E735 for ; Thu, 22 May 2014 17:01:49 -0400 Received: by mail-qc0-f180.google.com with SMTP id i17so6811562qcy.11 for ; Thu, 22 May 2014 14:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=QkvcI5jm7R3ZpwxeezAiEYbxN2qYeBg7XrkGfCdFxp8=; b=YHaKz78W0gSPqDaA7vzENi1r6UNSwhqKvj01ijM1vcqm3kqcv9eno9pfKaH/h3Fp/q 0Rdc4V/08TZSe6RrWFmcMxQwpN1v1byqYAOt4ZY4g+YdBzJmDMrAt034qOQB9ltqYWfI eZAbT/Gc0in5XIvCW6plExSYP2H2fU/QkrzUVJB7I+kwAu8Wmi31Kq/FHgojQsygfMIp T85vmvFk7chKjsNaAGHk+KeCJseH6EAvO4pzW1s+M2xwmQU2CJdkklAwj3LgIQnmJjOD vYufEr/11NcLfF37c9Hab7Q4iN4pTFm68No0KAtt01/5ZgdhUck/eYLlc3GMxGaFnN++ +MyA== X-Received: by 10.140.20.144 with SMTP id 16mr357960qgj.114.1400792506199; Thu, 22 May 2014 14:01:46 -0700 (PDT) Received: from ?IPv6:2604:2000:1118:4036:62a4:4cff:fea8:603d? ([2604:2000:1118:4036:62a4:4cff:fea8:603d]) by mx.google.com with ESMTPSA id s13sm1430436qay.39.2014.05.22.14.01.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 May 2014 14:01:45 -0700 (PDT) Message-ID: <537E65B6.3060205@gmail.com> Date: Thu, 22 May 2014 17:01:42 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: 'internals' Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: filter_input and auto_globals_jit From: garyamort@gmail.com (Gary Mort) Here is an oddity which I'm not sure how this is supposed to work. If you have auto_globals_jit enables then not only are super global variables not initialized unless they are called, the underlying data storage for the original data[used by filter_input] will not be populated. As I read filter.c, there seems to be a weird schism on how it deals with this. https://github.com/php/php-src/blob/master/ext/filter/filter.c#L526 For INPUT_SERVER and INPUT_ENV it seems as if filter will make sure to initialize the data, example: if (PG(auto_globals_jit)) { zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); } For INPUT_POST, INPUT_GET, and INPUT_COOKIE however there is no safety net. For example, with Just in Time: test.php?var=test $before = filter_input(INPUT_GET); // $before = null $var = $_GET('test'); // $var = 'test' $after = filter_input(INPUT_GET); // $after = 'test' So the question is, is this by design? In which case I'll update the docs. Or is this an oversight? In which case I'll open a bug and submit a patch.