Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108208 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14330 invoked from network); 21 Jan 2020 22:42:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Jan 2020 22:42:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 102CF18050F for ; Tue, 21 Jan 2020 12:51:11 -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-oi1-f196.google.com (mail-oi1-f196.google.com [209.85.167.196]) (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 12:51:10 -0800 (PST) Received: by mail-oi1-f196.google.com with SMTP id 18so3941034oin.9 for ; Tue, 21 Jan 2020 12:51:10 -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=uIFrYCraSiZUl0YXMW1NAwMzsuJPrjxE2MwZfxM7PwA=; b=DHlPRn9RaOjNDRvYi5Jlx5TUz86BDGvaX+39hN3CKVA9MwrixY08m81Y91uqUVHsnV SL4/gAQZT7j775znZBx3NVx7+n6LqllMf6p4fdzcVwM1jpMFtsOV7bVWLal7sMky0ef+ aUAtndXQxhCdZaeBN4TlqnKG00f58BqODdf1wM+xb5yYNP8uBw39qZgvj1Do0nXI4m3d t+gnuG27cLXpMExblheaGuMlNxOmSOIrwRSYwfsZdODB5MCALD9n7cs4njBPBncn9mA1 5hY4XmNFtzBWHDWm8ww7+QR4Qk6rXa0c0XVFAb/DB9hRnkarI6Dw3sugTTk78y2shMLB cX2Q== 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=uIFrYCraSiZUl0YXMW1NAwMzsuJPrjxE2MwZfxM7PwA=; b=TwJLt8J/fvg00w3Tbq/tFiUN1n9nrYmmlmUjiNO2Q+jSYu2mSDVBng/a9nE/oVg2oC AW7EVzezoaXBxBubGtsqMB6wnn6cG7kvq2REUcSXttl1BjCFvv1LyUxNoLm/w7Q/LXIP xL0d8GFeRqj/b3wecpcfGkXFIFK9xCHTW64aoUOqviW4+Rcuec4o3SPJaQQt0IMwBa6F Pazj66XMBZNVkaUPP9km/+tFqkv+zETqr8rSfMa2SwdyHaR/bOgmWkEiSzxvO4Y2rKjz 08esJjCGzR9CkO1841k9/LoMQTxT9c4L6UmojpR8lJpvyNjPfKYeix/KXaJrQHPkA+8n bZog== X-Gm-Message-State: APjAAAXlBUJHGbFeVh4ozVscy2z3uMr6OJeKitnue7qj++u/W9Rgfhe7 W3AVho6oFCseH3FrUM34vjzbCbUNgJmp8hYTOZo= X-Google-Smtp-Source: APXvYqxlzuM2ZPw15KQALvRlM6BJSxO1Ve67B5QeTaXPzFJYtlPC2O3rwNln2QhWn2qfeqfHq0isj3waCvVU17EW444= X-Received: by 2002:a05:6808:312:: with SMTP id i18mr4548750oie.44.1579639868159; Tue, 21 Jan 2020 12:51:08 -0800 (PST) MIME-Version: 1.0 References: <0c59dbea-2df6-d13d-e6f2-79495b6c1603@telia.com> In-Reply-To: Date: Tue, 21 Jan 2020 21:50:55 +0100 Message-ID: To: Philip Hofstetter Cc: Nikita Popov , =?UTF-8?Q?Bj=C3=B6rn_Larsson?= , George Peter Banyard , PHP internals Content-Type: multipart/alternative; boundary="00000000000036fd88059cac91f8" Subject: Re: [PHP-DEV] Adding TypeError and ValueError to count() function From: oludonsexy@gmail.com (Olumide Samson) --00000000000036fd88059cac91f8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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? 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 on= ? > > 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 > > --00000000000036fd88059cac91f8--