Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74371 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17293 invoked from network); 19 May 2014 21:42:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 May 2014 21:42:39 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.192.45 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.192.45 mail-qg0-f45.google.com Received: from [209.85.192.45] ([209.85.192.45:48024] helo=mail-qg0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/13-33069-ECA7A735 for ; Mon, 19 May 2014 17:42:39 -0400 Received: by mail-qg0-f45.google.com with SMTP id z60so9928656qgd.32 for ; Mon, 19 May 2014 14:42:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=AZIYQ4eTfSLePyfaloKjIWAd5BBM6HXlX4Z2jYDd5gQ=; b=QjjnlkkA5sZYGCM+kRWSsFN3aops/3xF595H9x9mDIq3ibLDXo24UU/uWAPfyEfWxW xnDKxJe+CT/FdO9ALas0gJqo0plWaMANvMuFqaiSu/zavGtjH1atP4VoKALqZNqGZdRO n/a2qsdLuvYCELc206neI4hOEWw5ubOW7HWJGD/n6KW6KcwO4LV93gJPav7SgYFp5uQU P8/9SP9z3zIMx/IRLL7JI4+If8A/kjfE8LxfWA/qCheXFy9xWuhilPyxuS8xZvbghVNV NoaCTLUIzCQ58eVC0l1HkPx6ucSNT/Zxiw46NN4Y9Ik9dPkzEhHbV0y0Ee2geVKyNC25 /PrQ== X-Gm-Message-State: ALoCoQkMU0fQfZ1k0NexmGXwiNlTZUq4hcJrD9T+8XXlACAV0U5P+57kHA4rKyZ/5oTvX0riQiES X-Received: by 10.140.18.180 with SMTP id 49mr50717137qgf.105.1400535755956; Mon, 19 May 2014 14:42:35 -0700 (PDT) Received: from [192.168.200.30] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPSA id g8sm29430376qag.43.2014.05.19.14.42.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 May 2014 14:42:25 -0700 (PDT) Message-ID: <537A7ABF.6080201@lerdorf.com> Date: Mon, 19 May 2014 14:42:23 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Gary Mort , internals@lists.php.net References: <537A62D6.6050704@gmail.com> In-Reply-To: <537A62D6.6050704@gmail.com> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="usXMIAftmvQnM86hh3na7MJunAvRXEpnm" Subject: Re: [PHP-DEV] Globals, closures, and filter_input From: rasmus@lerdorf.com (Rasmus Lerdorf) --usXMIAftmvQnM86hh3na7MJunAvRXEpnm Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 5/19/14, 1:00 PM, Gary Mort wrote: > This seems to me to be an odd combination and it is not explictly > documented. >=20 > I'm running under PHP 5.5.12 >=20 > First off, when after executing unset($_GET) - the global $_GET variabl= e > no longer exists. However, calling filter_input(INPUT_GET,...) > continues to return data from the query string. >=20 > So filter_input and filter_has_var are independent of the $_GET > variable. IE they will return whatever the original data was. This is= > noted in the comments regarding these functions, > http://us1.php.net/manual/en/function.filter-input.php - I simply want= > to double check that this is working as designed, and not a bug that > will be corrected[since there is no spec for this feature. :-)] That is working as designed. The whole point of the filter functions is that they keep a copy of the original input and only expose a filtered version in the GPC globals. When you need unfiltered data, or data filtered with a different filter you can call the filter functions to do so. That wouldn't work if the initial filter operation was destructive. > However, global variables are not supposed to be bound to closures and > objects, then this could result in future problems if that feature is > ever modified. I don't see why we would restrict the super globals from being bound to closures in the future. I see nothing wrong with your approach. -Rasmus --usXMIAftmvQnM86hh3na7MJunAvRXEpnm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - https://gpgtools.org iEYEARECAAYFAlN6esAACgkQlxayKTuqOuDYVwCdGlY8lCsyj+wtw8zaWXlhq6S5 sk0AoIPCsY+JtGUw6r2yQqIHGj5cMsbc =Pk08 -----END PGP SIGNATURE----- --usXMIAftmvQnM86hh3na7MJunAvRXEpnm--