Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115162 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 22797 invoked from network); 26 Jun 2021 17:29:14 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Jun 2021 17:29:14 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DCD141804C3 for ; Sat, 26 Jun 2021 10:48:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 26 Jun 2021 10:48:31 -0700 (PDT) Received: by mail-qt1-f176.google.com with SMTP id c22so10081703qtn.1 for ; Sat, 26 Jun 2021 10:48:31 -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; bh=a74yveU4oONBT1XFF8h0IqeguGhLHSt//eP0QzwO0sk=; b=ZuhMTzVvcQt8Tow+pHtDPL8wB79lWZD/6DBj8TUZJFwis98mVt3aoX5O4OLDTd2f97 BFE0BJcd5ptrgfj110lasGxzQJ3lo9bdJXqS3a75SzMBXhOI9gbmVJxLOOpTu8q2xr60 yGrKEXtOS1lyQx8ZgrxKQxGkwRxOzLz946yyLE3HD6nQYFUNOn3Ozww6lFz1UbmW+xRf 4D+DMEchM3gRx0a36z5XWUPt0XH0yKNdb2tjPG3iz2kKE1b/VvklighQBgKvPNoJLYIr S8b1rx1rRj7pfKxY8mJZIkftH7W+0KcyU+vYOlvsq7o092x/FUHWigrvODiBsxao3o4y 9mQw== 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; bh=a74yveU4oONBT1XFF8h0IqeguGhLHSt//eP0QzwO0sk=; b=FZ2Cvw1fyy3K+3nxIh2BlHdU/S7KDjA3NAVTTdOv8a29pBCf3QhnP+4/qUNXPdsN1u RI3EkyU8SpK5gxfSe8uY58DbqcbbK4IsXzI+vP0EG8iksl2UgV2GA8BKDpfAbZvC9p08 TAiIRpyosGtx3qp+Qy8uSyd9H4SepQb4oH2QwA+oWtYq6g4PcjLJ8+qRQ42D5fCPDnSu L8a40gbjApL66QdtzUcpJgHyRBfgqsDUkTHNgVyrKhmEuA55QnEas5EUTUANjNk6D9kZ t+ESLItqd2UyoI/jpUE24Z4+MFkfZWh9KM4KS9mH+xtGxoq1TW9um1W9HmegHaPxtNfS Y6aQ== X-Gm-Message-State: AOAM530+T0hKPAtTuO+u1MOlY56gq6aH4Jbiut3KCrBgIO5UQROggV1M 3/ZYUUWPJsD1R8lM57r5aZUHVfgX3l/ZPNOQ0piRE/tHGUl42dI7 X-Google-Smtp-Source: ABdhPJxIFK+OjK6q4q2yXCvZ+fy6rZzXrwPgNg7sVHg1EfAbwrEzc+b6tukUWR6yDxLSyjfJAPDvXV7QOA7K7JRUuoM= X-Received: by 2002:ac8:5a44:: with SMTP id o4mr10675927qta.105.1624729710535; Sat, 26 Jun 2021 10:48:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 26 Jun 2021 18:48:20 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="00000000000040a7ec05c5aeddab" Subject: Re: [PHP-DEV] [RFC] Deprecate boolean to string coercion From: tekiela246@gmail.com (Kamil Tekiela) --00000000000040a7ec05c5aeddab Content-Type: text/plain; charset="UTF-8" Hi George, As someone who has fallen victim to this silent bug in the past, I think I would be on board with this change. Why only implicit casting? If we compare this to the array-to-string casting then the warning happens for both. It would be more consistent to deprecate both implicit and explicit. I'd imagine it would also be easier to implement. I'd say that printf() family of functions should also throw the deprecation notice, even if we only deprecate implicit conversion. I am under impression that most of the time when this kind of conversion happens the expected outcome is either 0 or 1. For example, when storing a boolean flag to sqlite database. Could we not change the false value to 0 instead of deprecating? Regards, Kamil --00000000000040a7ec05c5aeddab--