Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108830 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94058 invoked from network); 3 Mar 2020 17:19:15 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Mar 2020 17:19:15 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4DD7E180088 for ; Tue, 3 Mar 2020 07:38:25 -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,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-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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, 3 Mar 2020 07:38:24 -0800 (PST) Received: by mail-lj1-f179.google.com with SMTP id e18so3978651ljn.12 for ; Tue, 03 Mar 2020 07:38:24 -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; bh=Ag7FO9UjbnS0XVKzKVyLeFP8jTPbQ1Ye3L0lsAw1mNM=; b=C/aONbN4cNUp/tcvVWwgNaZVk2EDSiyw1jtnT6QXM7LTIqxHDgGCvT5XQ2uqyyFMy+ DYHzwjse6UJx+mPvX6ugP23TYHaLzOMHxjbAjsZQE+4ojxfAF80cRv9W0wSsl0CoI+VE OKW3BJjzj0fgrntfzBXLPWCrFodYXz3pRQJqylmKWbr5cYYuj/6NtRjT9RtRNbVNGxQh 866T9E3VfSQfp0zkRfPBRhPf0OuQFQ5wDSJaRfA28Dr2LXJDoQoE6tWjiPydUQwl2vr7 oI9/q7JxOHXtrmRFvaxTi/IcsMQCY+oLWJuYV7RBYCO5eeZaZqdKEqDvIhiFM7H9hLqp VjRQ== 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=Ag7FO9UjbnS0XVKzKVyLeFP8jTPbQ1Ye3L0lsAw1mNM=; b=s1i/7Xa+XdZVeztbV1UsvP6ipZo6qEdY9n0HXDUkBB+Az78PJmMemi2DaO+S2itlo9 RrNl6UbTrBcAmU+YUCU6mTcQZcNXzxbW8AYR56aIomyQY9MQRc29Wc3OF865aAY6xfpK krLATLPDC1JA+tPwYsjXvmMMCRGtCIMQB5Rh5IqHDXWmTMXo0MNzeoDPqxVILo/xliiz dd4eEXwMYBpGsk1uBWbnr5Jd67V1aBErM0G3jILWl4I4M3EqtfL/0EUlAzns1V0JZot/ Tbiw3HIMYBWH8tkbBjOrucOBT4ciJ4fcUfyi6PSZ2/ZrVg0d6Ioy444BUljDadE4NT8G Gjig== X-Gm-Message-State: ANhLgQ3h/F2ZQK9WJIURfilwYlkP4MszjRyXsuqNO1gFtjs9M2twVxr1 oi6TisrBOTA2XPsaD7wrdTAQCPEoVHszqb0eSLmxFO8d X-Google-Smtp-Source: ADFU+vsfJYVovukubpCpH3/cVYohB3M/1LEUrxKZXzB1tqOye553Pm7iBR/ZkVy81kmjxyQOHKDET4/y8y3EM/twf8Q= X-Received: by 2002:a2e:b554:: with SMTP id a20mr2849546ljn.34.1583249900673; Tue, 03 Mar 2020 07:38:20 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 3 Mar 2020 16:38:04 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000ebcca9059ff5173b" Subject: Re: Deprecate ReflectionParameter::isArray() and friends From: nikita.ppv@gmail.com (Nikita Popov) --000000000000ebcca9059ff5173b Content-Type: text/plain; charset="UTF-8" On Tue, Feb 25, 2020 at 4:33 PM Nikita Popov wrote: > Hi internals, > > I've put up https://github.com/php/php-src/pull/5209 to deprecate the > following reflection methods: > > * ReflectionParameter::isArray() > * ReflectionParameter::isCallable() > * ReflectionParameter::getClass() > > These APIs have been superseded by ReflectionParameter::getType() since > PHP 7.0. Types introduced since that time are not available through the old > APIs. The behavior of these methods becomes increasingly confusing with > additional type system extensions. With the addition of union types in PHP > 8: > > * isArray() will return true if the type is array or ?array, but not any > other union type. > * getClass() will return a ReflectionClass for T|int etc, as long as the > union only contains a single type. T1|T2 will return null. > > There is really no reasonable behavior for these methods in the presence > of union types; we should start phasing them out. > > One point I'm not sure about is whether we want to deprecate > ReflectionParameter::allowsNull() as well. Logically this method belongs on > ReflectionType (and does in fact exist there), but the way it is formulated > is still compatible with union types, so leaving it alone is a possibility. > > Regards, > Nikita > Any more feedback on this? Nikita --000000000000ebcca9059ff5173b--