Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108212 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 45352 invoked from network); 22 Jan 2020 00:43:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jan 2020 00:43:55 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C15AC180541 for ; Tue, 21 Jan 2020 14:52:40 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.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 ; Tue, 21 Jan 2020 14:52:40 -0800 (PST) Received: by mail-lj1-f176.google.com with SMTP id a13so4592552ljm.10 for ; Tue, 21 Jan 2020 14:52:40 -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=PX8u3NcpjG3WxeqZq/x/IWhsI9WgcPfi8PgS55Eu8mA=; b=K2sQRmxaQKWM/4lkKDFtVWN3DLQGAHHmrUIXmbxJTL3ECsfXF6hKnto2RamyImyjn1 q5TCcEr7g2REfePjDCkvQ83lVAZFaWYB6jKuVnW6Vsi/dE/BTm7EoQTXdD7paCy3eepU crYY1YUoDVin0pPi+XHyr1nvilT68usoII2Kdl/y0DsC5T0+h0a/NhwsOzspILU5r9Hg GqjiwUikbCmCuluYJ1jLfg2h/M4aKCcEQFoP0VzkiWxM3uK+tS0q7P7/fhSBxzRzwLSH MnUUA6GTdjnU+dDRiDkV4+aHajaGheOdfgS8+zVmFExenutkUOlSR0YwE211dOoV2fT7 seVA== 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=PX8u3NcpjG3WxeqZq/x/IWhsI9WgcPfi8PgS55Eu8mA=; b=pUHXqWSkCmQlR2IOLo74+xhIzwQd+QAyBAFBLplFSbR4pJGGsZWzd91hrpYcDPIgyd dDTBB8hJ1DmnY3xavKL1+uLjYnjTq2W57isNOFA5i6CnQh1bwgx4CYxTeyjR/M5Cd4G4 +8yW5E6NOo+SVELU0Sj9QRSBNmiVPcwr79EXxWC8bEUmzXbemWAd3etxxu4ZgXPzm8X0 d3oP7Q+d0xAyx5ULWSuCjWUiFnzYndQ2KUI7EmYw6YRhLFrdOaCQMdgoGSkzq2Hzkuua RldfNomMG2LNupL9/XrLErwctk30IBUCz7t9s69f72mhgAAEzztJHariyUyBZGCriUtX 1OlA== X-Gm-Message-State: APjAAAUsV9hpvObKgv9wK3UpY2XRMwd6BhQ5pjnDy7War6uDVwj96y8a 2sB6U4f/h7KtjmiG9B4m9aamoTJ6zX/6TclDYm0= X-Google-Smtp-Source: APXvYqywPF75y+Vd0R6MzeMwVUSx2NONHFXKZxsahnk92uwzQFjbnk7pRI9PzYCQp1sDs5oFQxYtUzP/VobdPjzZpPM= X-Received: by 2002:a2e:8946:: with SMTP id b6mr3737083ljk.1.1579647153928; Tue, 21 Jan 2020 14:52:33 -0800 (PST) MIME-Version: 1.0 References: <0c59dbea-2df6-d13d-e6f2-79495b6c1603@telia.com> In-Reply-To: Date: Tue, 21 Jan 2020 23:52:17 +0100 Message-ID: To: Olumide Samson Cc: Philip Hofstetter , =?UTF-8?Q?Bj=C3=B6rn_Larsson?= , George Peter Banyard , PHP internals Content-Type: multipart/alternative; boundary="0000000000007afe7f059cae4395" Subject: Re: [PHP-DEV] Adding TypeError and ValueError to count() function From: nikita.ppv@gmail.com (Nikita Popov) --0000000000007afe7f059cae4395 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 21, 2020 at 9:51 PM Olumide Samson wrote= : > Only lazy developers would complain about updating legacy code, perhaps > the code itself is worthless and need not be updated. > > Then, what's the point of pursuing latest features or PHP version when a > individual or a company can't pursue code upgrade before version update? > Please don't be rude. Nikita On Tue, Jan 21, 2020, 8:41 PM Philip Hofstetter > wrote: > >> Hi, >> >> >> On Tue, Jan 21, 2020 at 6:17 PM Nikita Popov >> wrote: >> >> > >> > In the cases you encountered, do you know what type count() was used o= n? >> > Was it null? false? Or something else? >> > >> > Nikita >> >> we were in a similar boat as Bj=C3=B6rn to the point where we manually >> patched PHP in production in order to not emit that warning so we >> could update PHP while we were migrating the code-base. This made the >> 7.1 to 7.2 update the most painful update in the history of this >> application (which was first released when 5.0.0 came out). >> >> The most common case was `count(null)` which unfortunately was >> happening all the time because of functions deciding to return an >> array with elements or null if there was no elements to be found. Yes, >> that's bad form, but hey - this is a nearly 20 years old application. >> >> Of all the changes I've seen happening in PHP, this was the most painful= . >> >> Philip >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> --0000000000007afe7f059cae4395--