Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104453 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 78825 invoked from network); 17 Feb 2019 19:40:24 -0000 Received: from unknown (HELO mail-it1-f195.google.com) (209.85.166.195) by pb1.pair.com with SMTP; 17 Feb 2019 19:40:24 -0000 Received: by mail-it1-f195.google.com with SMTP id y184so35737139itc.1 for ; Sun, 17 Feb 2019 08:24:34 -0800 (PST) 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=/mr6pwboYpL16Ad70Ux3e0Bv0QYzQqNpCw+Luwrumeo=; b=vhr45dE/mIhpVEcYH2WU0HDnvaiGuhKMP87TkNBdZSOca1hDz0banL1a2/94kLoV8k b4i7Kjev4rYtt3dZX9DFec/l8TeAA9P+PLmdoiped0wD7y31wIP42QtAa1jm3tZzWl+6 7UrzQu6Pk4yaSKj5ruYfmHpPgTR7Ht7QKeYp0Ys5ukvcNHCalYYnBRIl4AGv8Ur5Al90 cKXcvEwbFrt2Yqey9tzd5un11WAarQ4TTbtaMMKbe7isfE3wNgBVONwHqu5t3pDMIl7T cBm2Av7Q6QTWmQTW2xwGX3sh3j5RZt2rYbhYr1l/qdO6dHFYd7YtHXUgV94sTcj24QY8 uJQA== 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=/mr6pwboYpL16Ad70Ux3e0Bv0QYzQqNpCw+Luwrumeo=; b=Z5nOoYefdx00TTbK4X4aUejSlOeBkr0ICuaZ2J8VtoHrijwfNw0zjhpv2YrwcDRkjy 6KVi3Y7ZmNj7LejtFLz85qPfofqBTKZtLJxIYr0YmrHUBKCeHwwSosw3OLO/IwEeN2XC bWrffc3S7gYyJudvImUFT4XXHzOJ8LBxcDIhWjS/6rQTheSOzCMEbknzveTdKK7eR+Xs HMXVRUgCzRKWPcyAtU6JeUG3bcfvW7IyY2MGHTKF0qvlwXlTa/Ny7F0H+sNNdyfiJG+j ZKFxJmKeIehrQ3WdOBmq2NZ5BzCfI4fz8w9aQmASvrZFiKV6kePDOoWSxhK8ME3ZNQ02 yYqQ== X-Gm-Message-State: AHQUAua17O/k1+4G7JHCMI0kFVUdv7mmg26LCNr1q6Nlm5e7LyOD4PHn G8KGy8UbtHd6dvwds4jTvzadgGoIdEdpJaoz2DQqJQ== X-Google-Smtp-Source: AHgI3IaZEU33hwh5frnL/DYF9cw0JtGw+bm03KJxwELc6dssXWjuxmO4qgL373hXQubE6bdDdReru7Bh+CtcCgF1eA4= X-Received: by 2002:a5d:91d3:: with SMTP id k19mr11282241ior.258.1550420674154; Sun, 17 Feb 2019 08:24:34 -0800 (PST) MIME-Version: 1.0 References: <226B512C-02A7-4555-9288-D7A2DA89F068@benramsey.com> In-Reply-To: <226B512C-02A7-4555-9288-D7A2DA89F068@benramsey.com> Date: Sun, 17 Feb 2019 17:24:15 +0100 Message-ID: To: Ben Ramsey Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000891595058219718c" Subject: Re: [PHP-DEV] [RFC] Consistent type errors for internal functions From: nikita.ppv@gmail.com (Nikita Popov) --000000000000891595058219718c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Feb 16, 2019 at 6:34 PM Ben Ramsey wrote: > > On Feb 5, 2019, at 05:22, Nikita Popov wrote: > > > > Hi internals, > > > > I'd like to bring forward the following proposal for PHP 8, which will > make > > (zpp) parameter parsing failures always result in a TypeError (rather > than > > generating a warning+null, depending on circumstances): > > > > https://wiki.php.net/rfc/consistent_type_errors > > > > The goal here is to remove one of the inconsistencies between > user-defined > > and internal functions, and to put us in a position where we can actual= ly > > start specifying type information in arginfo without fear of breaking > > things. > > > I like this RFC, and from a user perspective, this consistency is > much-needed. > > While warnings don=E2=80=99t affect continued processing, uncaught TypeEr= rors do. > What is the recommended upgrade path for users? How will this affect the > silence @-operator, since I=E2=80=99m sure many users use that to squelch= these > warnings, and they accept the null or false return value as acceptable fo= r > processing the rest of the script. > > Cheers, > Ben > The recommended upgrade path here is basically "deal with it". If a codebase does this (intentionally calling functions with invalid params and suppressing errors) a lot, then it might make sense to register an error handler that collects all "expected parameter" style errors in a production environment, to easily identify all code that needs to be fixed. The error messages have a consistent format, so it should be simple to identify and eliminate all warnings of this type. Nikita --000000000000891595058219718c--