Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102013 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50556 invoked from network); 2 Apr 2018 11:21:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2018 11:21:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=info@pieterhordijk.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=info@pieterhordijk.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pieterhordijk.com from 185.78.96.68 cause and error) X-PHP-List-Original-Sender: info@pieterhordijk.com X-Host-Fingerprint: 185.78.96.68 mailsrv1.hostingfactory.nl Received: from [185.78.96.68] ([185.78.96.68:47433] helo=mailsrv1.hostingfactory.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/F1-35059-35212CA5 for ; Mon, 02 Apr 2018 07:21:56 -0400 Received: from localhost (localhost [127.0.0.1]) by mailsrv1.hostingfactory.nl (Postfix) with ESMTP id 8E42310406F3; Mon, 2 Apr 2018 13:21:51 +0200 (CEST) Received: from mailsrv1.hostingfactory.nl ([127.0.0.1]) by localhost (mailsrv1.hostingfactory.nl [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id FvqzVOcqFMje; Mon, 2 Apr 2018 13:21:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mailsrv1.hostingfactory.nl (Postfix) with ESMTP id 4721810406C6; Mon, 2 Apr 2018 13:21:47 +0200 (CEST) X-Virus-Scanned: amavisd-new at mailsrv1.hostingfactory.nl Received: from mailsrv1.hostingfactory.nl ([127.0.0.1]) by localhost (mailsrv1.hostingfactory.nl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 69Fr3UH0vzMp; Mon, 2 Apr 2018 13:21:47 +0200 (CEST) Received: from mailsrv1.hostingfactory.nl (mailsrv1.hostingfactory.nl [185.78.96.68]) by mailsrv1.hostingfactory.nl (Postfix) with ESMTP id 2F79D10406C1; Mon, 2 Apr 2018 13:21:47 +0200 (CEST) Date: Mon, 2 Apr 2018 13:21:47 +0200 (CEST) To: Gabriel Caruso Cc: internals Message-ID: <2146941281.24754.1522668107133.JavaMail.zimbra@pieterhordijk.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [185.78.96.68] X-Mailer: Zimbra 8.7.0_GA_1659 (ZimbraWebClient - FF59 (Win)/8.7.0_GA_1659) Thread-Topic: Make compact function reports undefined passed variables Thread-Index: tUef35J6XG2EWxXMfnNsqLmPt6NTug== Subject: Re: [PHP-DEV] [RFC][Discussion] Make compact function reports undefined passed variables From: info@pieterhordijk.com (Pieter Hordijk) ----- Original Message ----- > From: "Gabriel Caruso" > To: "internals" > Sent: Monday, April 2, 2018 11:17:43 AM > Subject: [PHP-DEV] [RFC][Discussion] Make compact function reports undefined passed variables > Hello dear internals, how are you? > > I'd like to propose a new RFC to PHP's core, but as this one contains a BC > Break, let's discussed it before making anything official. > > A couple of days ago, while discussing some [Coding Standards rules for > Doctrine, forbidden the `compact` function]( > https://github.com/doctrine/coding-standard/pull/49), an argument caught my > attention: > >> The `compact` function var does not report undefined variables. > > Looking in [the `compact` documentation](https://secure.php.net/compact), > this is even emphasizes: > >> Any strings that are not set will simply be skipped. > > I couldn't figure out why this is done this way, but, here's what I'd like > to propose: make the `compact` function starts to report undefined passed > variables for it. > > With [only 2 lines of code]( > https://github.com/php/php-src/compare/master...carusogabriel:warning-unknow-compact-variable), > this is possible, but, of course, this is a BC Break. > > Let me know your opinion on that, and perhaps, make it happen! > > Regards, > -- > Gabriel Caruso Hey Gabriel, What I am missing here is the reason why we should break well defined behavior of existing functions. How is the BC break for all existing code justified? Pieter