Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108207 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96492 invoked from network); 21 Jan 2020 21:32:05 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Jan 2020 21:32:05 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 06DE21805A8 for ; Tue, 21 Jan 2020 11:40:49 -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=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15623 195.226.0.0/19 X-Spam-Virus: No X-Envelope-From: Received: from mail.sensational.ch (mail.sensational.ch [195.226.6.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 21 Jan 2020 11:40:48 -0800 (PST) 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:content-transfer-encoding; bh=AQur7cz/g3QmZ16Mk9KlZaACpq5axxApitF7V58s+AA=; b=eA7RWDTFbPhiQZxlouKbJjl2LAOD44hesf9DZbiUhLtNYw6a8uVftWlWxZlvHkkb9s M2ijv69hfWKRjkOhlY0L+AWU3IWs8cS3SLg+KoTcA9VaLcc5VyjIJlXUF1ikhph63FZV 7BZmPklkdcDjoQUFDNgmOTFTv0k8rxEvEqnE5ZsFWLEjZEKsb44hInPjF0QxeghxtwKr jpEfnESaNZPQpKc9I72+W2D13GlB8S2gDhg65cssoYdUyyjw77MKT4tcnbEQRSvi7VTV rShUR3AefPwaKiA8fOgHZPDDdeb8Z8ep5U1o4IUAPTQt7pdCM0dBDmXb0vE0v+axEyX/ nsIw== X-Gm-Message-State: APjAAAUeUwflwMZ75YBltUGPU6dpfeTbLpOf4Rdb8WqHDlY8yfNFPQ3s wLZZD8deRYYulYdNd1BJtxjB4Lv0WTpD/A8ND2T2bVIi3e372lwwA0tQ+V71Xw3s77WDEnUochS xJrNJLqBY0L58IXDKJOkm//MFWKvhJRKwF+1SU1v8+TqB X-Received: by 2002:a7b:cb86:: with SMTP id m6mr14126wmi.51.1579635645801; Tue, 21 Jan 2020 11:40:45 -0800 (PST) X-Google-Smtp-Source: APXvYqz0cqpARzNu+ZJ9extOh9sMgLO91ndbvj3qfIleWF2rQx+wVgK3k54xPL7PuIYhWMhmipsNtvhnDa+xvkYafvY= X-Received: by 2002:a7b:cb86:: with SMTP id m6mr14114wmi.51.1579635645575; Tue, 21 Jan 2020 11:40:45 -0800 (PST) MIME-Version: 1.0 References: <0c59dbea-2df6-d13d-e6f2-79495b6c1603@telia.com> In-Reply-To: Date: Tue, 21 Jan 2020 20:40:34 +0100 Message-ID: To: Nikita Popov Cc: =?UTF-8?Q?Bj=C3=B6rn_Larsson?= , George Peter Banyard , PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SA-Do-Not-Run: Yes Subject: Re: [PHP-DEV] Adding TypeError and ValueError to count() function From: phofstetter@sensational.ch (Philip Hofstetter) 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