Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116175 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7893 invoked from network); 26 Sep 2021 12:18:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Sep 2021 12:18:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DE89C1804DB for ; Sun, 26 Sep 2021 06:00:39 -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=-0.7 required=5.0 tests=BAYES_05,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-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 ; Sun, 26 Sep 2021 06:00:39 -0700 (PDT) Received: by mail-ed1-f52.google.com with SMTP id ee50so56892009edb.13 for ; Sun, 26 Sep 2021 06:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=boR5/4yfumj+MsjiGi/NQIKZmFd/6SySd0ItYUuJiaM=; b=PHz4R5G93BVlOYIEM5pyuKQq68/0x73ErTSIGhYCsvPtjtWpU++iehGYe4mdQZO5Yf jDq6gZLupO23Y7piDczyAGDzshl5h9P0USO93LMlR9dcMKTUgpzND1+eox5zxGpuhCfm mgIjmjYjbMDtBIhiMWP9TDhFnvxjGUggIb4kbq+MBzlSpt12jUGLX2HC09yPV7BoHMXk naXRSaJFw2nxfVnt2u4W2frL7dsJuzx6hCSaJG56jyMmTvScRPagJR/e+lrVt5TDYVmF JUphS2E9bZT9YKbHY71vgF5E8RmZXyJHjil7dTPuQ8YPpqFkLeRTmxZfCsZfQef8IAcw 81Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=boR5/4yfumj+MsjiGi/NQIKZmFd/6SySd0ItYUuJiaM=; b=D43roRXUT51GIRowC88QDHYEMqxaoHwmEBpTO7Nbo7ntwJ6rXnWuhy7gvOkyRnCFjl d27ydDUEZksm5cREcIOTpr9ZEgBPtmz1xFX49qmggse8AKT/4zZ9Ji7O3FfMvBXuj8+U LcpZmNX9LYVMztvBFmIgzUN+v0qgVrVFRG4b12ZQRVS8nmYLKHCjtlwnpCqvW7vQQdY5 RyYzE9ox0ppeeQiB4HQqDqE+1DF45LoE0nXCkC1NpbbcFqcPdWuIuvrjbQJaGEJRqn9V 5WpSlM0c8DThgh1URlL3yHaWfv4Dk9wqYBDxeDTud/5nyGaXj6hd6PiBJr2gXOEeC4NY jUig== X-Gm-Message-State: AOAM531pwL6Wu2sJMdol7J+VFNa55lKqmdlyJgJTc8uJeP0CI25qztjx TwcqT5za0tnnhujbcHJ+hPudYg4m2Q4AH0Z2O2S32px0 X-Google-Smtp-Source: ABdhPJzOw/ApnLIAXH2YxvM56315L42v8roLjVvY7sZlGFu0BYymFDpLMHsxBtI6U7DCeVkpiiAVgOIVWywVCQwK35w= X-Received: by 2002:a05:6402:510b:: with SMTP id m11mr18210640edd.82.1632661237710; Sun, 26 Sep 2021 06:00:37 -0700 (PDT) MIME-Version: 1.0 References: <12f54268-1a63-ad10-de01-ee03a6845ed9@seld.be> In-Reply-To: <12f54268-1a63-ad10-de01-ee03a6845ed9@seld.be> Date: Sun, 26 Sep 2021 15:00:25 +0200 Message-ID: To: Jordi Boggiano Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000001cc10605cce5919a" Subject: Re: [PHP-DEV] BC breaking changes in PHP 8.1 From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --0000000000001cc10605cce5919a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le dim. 26 sept. 2021 =C3=A0 14:42, Jordi Boggiano a = =C3=A9crit : > > > I'm surprised that is_resource() returns false for resource objects, > > does anyone knows why it wouldn't return true in such case ? > > > > This is a very weird behavior, I'd expect it to return true, moreover > > this is the most annoying detail of this BC break, in my opinion. > > > > I have lots of code using is_resource() but I usually don't bother > > checking for type (maybe I'm doing it wrong). But I'd also expect > > get_resource_type() to be deprecated somehow and return > > backward-compatible values for converted resources to objects. > > Right, having is_resource return true for resourcey objects would have > prevented all resource-related errors I ran into with php8.0 migration I > believe. That'd be a welcome improvement/fix for 8.1. > I'm not sure about this one: is_resource($foo) ? get_resource_type() is pretty common. Also this would break some expectations with gettype($foo) Nicolas > --0000000000001cc10605cce5919a--