Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108754 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92842 invoked from network); 25 Feb 2020 17:16:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Feb 2020 17:16:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BC3A4180088 for ; Tue, 25 Feb 2020 07:33:27 -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-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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, 25 Feb 2020 07:33:27 -0800 (PST) Received: by mail-lj1-f178.google.com with SMTP id x7so14541534ljc.1 for ; Tue, 25 Feb 2020 07:33:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=eaKqpV9rjvZ3Ixags740PKGtuPbd5IAuP9emNLx7dvo=; b=Gkr4ghWY6xST/2V9HeH1cVrvZyXrB7tidLDQrOXHxSDd20PGjjrOECcNBLk0FgL7LM 0/sk7oHOurEmrBI3LLnY47YVMXVli3M1SPUi2IWfN5RDLBeDq/laHCBu0NB1ifp5HUiu BopnzalQObev7bhjyngV61lFz3vywYw+lhod5S5BGQdVSMgV0Hz3+7Q/vyxwjMmE0xAx dEg3i6wpcdDBP1/48azWq17p3cHac2ifih9s0RlHbYGrK0AtvtLY0wAY2/dXEBzoLG3I Sjz+xgx0Z5JPboW3NWLIe+US3XLgIIXoiufAq3nYiRDcj7YTYqr7/gXREDz3YtaCF9NW t8Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=eaKqpV9rjvZ3Ixags740PKGtuPbd5IAuP9emNLx7dvo=; b=uQRkLX4pMlkmFT0BCeBxmYoeqF7gdGoebMhEcmgbTgjxsB8eYMerh2bgScHK6vuNyG 40fvXps/sn1MJmB9MUB4ggbdAn6Isk09iGpbJuQU31JWaTBNNLe4zfCInG0kWTQfJFJP xaZ5XSGP/XFfoS0NdUsVjvbFki7CnTZ9r4F+Rw8tFbfkYXzmHheVcPUHJGLTeGDDCOr9 vLcQXqmwpdMkTXSHnSgUe9IEibxUIdaH45KeOU9ctf8eYUiF4yuE/rRATLwWoT/9ceBP Ivb1QG3fbHGUxyXb9fpMCu5fXZAUKN0kVZufQLybjK/MXZwKw8TgnjirYBss3esW7UwZ ekOA== X-Gm-Message-State: APjAAAWSg8dHzpWfZDEexsAsl7ehpGm5X0eTtngFrDI4elceYzILgjyp XNQ3nsbqJnHfkM/fNik6q+Mc3oBv1BAlqOoZOvjRtdnGxAY= X-Google-Smtp-Source: APXvYqxyoQzfPfgb5HFB+Pkp1E7joxtSY/vzKmcTfc7nn7nOscRjpFSE3M7eroIBCbWS+ANFRULbB7jh474XjchqmCM= X-Received: by 2002:a05:651c:297:: with SMTP id b23mr34089021ljo.260.1582644803007; Tue, 25 Feb 2020 07:33:23 -0800 (PST) MIME-Version: 1.0 Date: Tue, 25 Feb 2020 16:33:07 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000004a025f059f68352e" Subject: Deprecate ReflectionParameter::isArray() and friends From: nikita.ppv@gmail.com (Nikita Popov) --0000000000004a025f059f68352e Content-Type: text/plain; charset="UTF-8" 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 --0000000000004a025f059f68352e--