Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102209 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42885 invoked from network); 9 Jun 2018 15:32:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jun 2018 15:32:24 -0000 Authentication-Results: pb1.pair.com header.from=david.proweb@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=david.proweb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.68 as permitted sender) X-PHP-List-Original-Sender: david.proweb@gmail.com X-Host-Fingerprint: 209.85.214.68 mail-it0-f68.google.com Received: from [209.85.214.68] ([209.85.214.68:40393] helo=mail-it0-f68.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/2F-62758-503FB1B5 for ; Sat, 09 Jun 2018 11:32:22 -0400 Received: by mail-it0-f68.google.com with SMTP id 188-v6so5082035ita.5 for ; Sat, 09 Jun 2018 08:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CqhytHi4uTKGD9KoaBbecOh41Rbg7hQzq2KW9mhrpVk=; b=TMp0325LP8RgK/eXWyr8jK15baTBDyfo14AcXpTL64U3XXBV2RCzJW0lreqh5ugRtR RyjY1S8Qhhqn0/mqY/Yn7oZC1yWmEyVQqNMUSHpIwXEyUjV0qKZQuzkFV540ID7xO9dX PAGBwBn+LOR5aTtfYRp/2R537TerajNsgLImTmg8773s3f4Lb6zELb9IHJLD9STsSJX4 jxUF2t0MDr9Ke9gq3lpDQJOOJWpnWRKaRUODa11gdNRxj++bbIbf9mrb+ejdR04AeT7b 3dE6Z9SO93/gKaQc/rniJoMWwS5472kdLS3OR3aTQ1oHTj4J9SljmD0jrBPeZD4gtLNu bMZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CqhytHi4uTKGD9KoaBbecOh41Rbg7hQzq2KW9mhrpVk=; b=r/SA2Lqc2ruc0H8M9VCSubzf9qoviGmbdOGG08FnvxIc0GGzY7xX5vGMhMmtdqPHUB ZS1wx6/ZRY5Pki6BXN5ZxdcPkWHvAJxXT74y0sJrcd4KnxgwR8Jp8ALpapQ27dHka4Og gP0AF1pTVh6AXbQ5evwkH0AHk1uxnnDbeReNUAxY/1nmT/zfBpv0XacBw9ifC0lVMx8Z exRZs90tQoQ9t0C/xtPIRsJlCC9QR/+CaGsYUpJ/l8awRt4FkTYrVMrD+BqojjknYUgN /aK/6yrADq28NzPvjRdmVxhiTGRA1+6fVEm6hmFmu/zK5figVlMtR8Eg/rEgOQR43bkA 9SvA== X-Gm-Message-State: APt69E3Iyc60bCSzw0CnCpi4KXVGWfs/pJ/KhP+n3xTDJmUsaAPe/rFY Co3qUjkR1e1eJIpqCCl2iK7jm6hXxUFLs1QZOoc= X-Google-Smtp-Source: ADUXVKJQITsomab1rS7YqMrVgZbCL+wn+o8RGk9UPTCpvtej3SBP6YUqaXaq8n/6pQcnF0QiE7hMS12reWptqv/Ui5o= X-Received: by 2002:a24:b611:: with SMTP id g17-v6mr5660089itf.63.1528558339406; Sat, 09 Jun 2018 08:32:19 -0700 (PDT) MIME-Version: 1.0 References: <5edffc76-33e7-9f56-83ab-c9ca129040a7@gmx.de> In-Reply-To: <5edffc76-33e7-9f56-83ab-c9ca129040a7@gmx.de> Date: Sat, 9 Jun 2018 12:32:08 -0300 Message-ID: To: cmbecker69@gmx.de Cc: Dmitry Stogov , carusogabriel34@gmail.com, PHP Internals Content-Type: multipart/alternative; boundary="000000000000d6c3ae056e37386c" Subject: Re: [PHP-DEV] [VOTE] Make compact function reports undefined passedvariables From: david.proweb@gmail.com (David Rodrigues) --000000000000d6c3ae056e37386c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Em s=C3=A1b, 9 de jun de 2018 =C3=A0s 11:27, Christoph M. Becker escreveu: > On 09.06.2018 at 12:03, Dmitry Stogov wrote: > > > compact(), extract(), parse_str() (with 1 argument) and > get_defined_vars() are bad functions, because they access local variables > indirectly. > > While I agree that extract() and parse_str() can be dangerous, I don't > understand why compact() and get_defined_vars() are =E2=80=9Cbad=E2=80=9D= . If the issue > is that these functions allow to access (local) variables by their name > (given as string), that appears to be not uncommon in PHP; cf. variable > variables and $GLOBALS. > =E2=80=8BAgree here. I think that compact() should be modified just to work= like compact($a, $b, $c) instead of compact('a', 'b', 'c'). It is very useful for template engines. =E2=80=8B > > > They might be considered to be removed in the next major PHP version, > despite of this fix. > > That would certainly require the RFC process, and in my opinion, a > deprecation phase would be very appropriate. Note that parse_str() > without second argument is already deprecated as of PHP 7.2.0 and > scheduled for removal in the next major version[1]. > > [1] > < > https://wiki.php.net/rfc/deprecations_php_7_2?s[]=3Dparse&s[]=3Dstr#parse= _str_without_second_argument > > > > -- > Christoph M. Becker > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 David Rodrigues --000000000000d6c3ae056e37386c--