Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102012 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45693 invoked from network); 2 Apr 2018 09:18:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2018 09:18:00 -0000 Authentication-Results: pb1.pair.com header.from=carusogabriel34@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=carusogabriel34@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.180 as permitted sender) X-PHP-List-Original-Sender: carusogabriel34@gmail.com X-Host-Fingerprint: 209.85.128.180 mail-wr0-f180.google.com Received: from [209.85.128.180] ([209.85.128.180:39420] helo=mail-wr0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/21-35059-545F1CA5 for ; Mon, 02 Apr 2018 05:17:58 -0400 Received: by mail-wr0-f180.google.com with SMTP id c24so12880613wrc.6 for ; Mon, 02 Apr 2018 02:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=9Svy/l0FOdF6KnpX7b7tkc0DEedc4hr05jXVgrYAM2Y=; b=Xyjjea5UrfTsZAe7MDPemHM1ux4OGZWe1TN0DZhSUahlPimoyqrtdmxV+v+B+Her2A FOpG+aTm8PCzOIjUq85JhKkM70wMw+iFRSk6nR5TmvnBYZ6D39YSmhte3rYUowc0k5jC SXhrhhqR15Kh4wb9OqKj3V993DqHPUQHlL5evaAbFFIFgO0Y97me8zZ017kuXVA6FVOK EzNtQUXj2kU5RulCZv5OBcnyeMCvAxDCIlgxqg9gCu2YVfcCApY9D/XJntGnzBwGbkOt pNCm9gBQC+l84PkT0rndwCKi5wpNAD8mi8fu5LnhQqQv3Z9HqYfO8poydZD1hBVYA/nO EV6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=9Svy/l0FOdF6KnpX7b7tkc0DEedc4hr05jXVgrYAM2Y=; b=tlTZCBJWWnnWlJFKBK6/CpTArKQTBTJgpRZte/hjFhE/l5fZszdLdCBaJQS7jTLpf9 e31MPdbvMPdegfcaxOuiq/yJawqhd9UTR+c1cWuevxYIDZGp4DYeBSnNlvju9cAcun1/ Nfk+EfALu1hSsjbeTNX2Vc7KKcBgmYZUeXUZ0Oy0gQZAMZxsnxMBT+/MBmA2SyYkOlqk zMjb6kqe7LSBUDBzPpIBR0ulM9bwAkfyc9DsgMgPvPY7JGbr3RrNZJ8mVDFrfmC3yE0B 8WihLRpo+wjw/cG2immaargWxxK8Q8FGXHMkeEEYWABUQTfuAbcGii7oflSIjX5DZTfv su3w== X-Gm-Message-State: AElRT7GSvPxFvIMpf0F4KHKNezMbA8sh7aE/n5UCBgLuibL0KygdbXWc H43Y5q3YXCFe1/+SRxZHEo7ydO28NKkPCTNlpaI= X-Google-Smtp-Source: AIpwx48QQqjpnrqOpjExzhVLhY1xcGkTSV0wl/7JJE6o618+JDAgor8Ioc5rGiB9OFS3aF4JD+SXBsW3a9k6ODPCNps= X-Received: by 10.223.157.3 with SMTP id k3mr6441713wre.179.1522660673699; Mon, 02 Apr 2018 02:17:53 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 02 Apr 2018 09:17:43 +0000 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="f40304388d4c91c7320568da1026" Subject: [RFC][Discussion] Make compact function reports undefined passed variables From: carusogabriel34@gmail.com (Gabriel Caruso) --f40304388d4c91c7320568da1026 Content-Type: text/plain; charset="UTF-8" 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 --f40304388d4c91c7320568da1026--