Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112869 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 79850 invoked from network); 13 Jan 2021 13:09:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jan 2021 13:09:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D030A1804A7 for ; Wed, 13 Jan 2021 04:47:06 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 ; Wed, 13 Jan 2021 04:47:06 -0800 (PST) Received: by mail-wr1-f54.google.com with SMTP id r3so2002931wrt.2 for ; Wed, 13 Jan 2021 04:47:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3lw+8RdMJ4MiZQQHMVvhAptWr8k8CpAuTMWfHQkm4ZQ=; b=YfPDU/BkNWn/jcwqJ74DCOeZAmKsnrZlpAOik0+R9mq1z5L4N8pgpNaGRHgRqTFeEm xRI/uxbGNgZh/JCEteXoUliwDMKZg57q/J52k2PtO8LldmllrfIX8g2JffSdkYOFKzKV MuiAcclA8XBWk86h1WxTv12sUSVAR2q7M/otYWK/L54pX/i95coW91uoaLweHF8u/kZk z7aiphu4i87QtYRgiDenJnxISiXz2jbhFBgXqWuAkON3JLXTjscaw2jlu/7RTa9RaRdq MvMsoLlPjYBeW1/5PQ/jI/kEfvSjiw5BzJtWbk8QDAH1D/81Ke5QTDL05bbxgi2kBiGk y5cw== 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=3lw+8RdMJ4MiZQQHMVvhAptWr8k8CpAuTMWfHQkm4ZQ=; b=FB0ggWMrZyCfMEFtTdbvnnbGQe6L0zbwOqa1NCNmZHUmDd4fW1oNp9WCbC0hXAVesc FHpzpt4qEApMvLXn6GwZagiKEeGsQpQtmT1XYQG8jC6YsDR+ebVOWwyeswvy1fllZEwe Tj1MjKR11SJfEn53rYsseGnsrg35caCOZyL8v6A8grZVYrG5ub0jlbq4m8x6p0cLbDMg 6GA9VXOgB7Mcfo5znZLhoL0TsUIyGf2eDS/ZF1yU4/EPCaupOianV5y5RypowQwlV9xo ULgMfE0v1TYOgqiiDDUhTLtsWZSEQ9Op5/et4+EIS1zC6mGofTdXZSybVWu1ZHb6BEC5 rA6g== X-Gm-Message-State: AOAM531W9jxhy2kAcNVgTB2Eef/8CRm/aWCkN/rMnyYACsNZWhS7G6Ok hSUatcZECQVn96/9hc7ZzI7n0ItDrL1XDuUPECbnjA== X-Google-Smtp-Source: ABdhPJwb1P9HG7UusUcTBaqP2NZzihpWRpAzh7XqMHdbHrPJiOR9jwdOZedKG6RD7GiQToVUwvjEVaki3YmJnu7aGA0= X-Received: by 2002:adf:f605:: with SMTP id t5mr2419828wrp.39.1610542025096; Wed, 13 Jan 2021 04:47:05 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 13 Jan 2021 13:46:54 +0100 Message-ID: To: Marco Pivetta Cc: "G. P. B." , PHP Internals Content-Type: multipart/alternative; boundary="0000000000004d50ca05b8c7899f" Subject: Re: [PHP-DEV] #[Deprecated] Attribute From: kontakt@beberlei.de (Benjamin Eberlei) --0000000000004d50ca05b8c7899f Content-Type: text/plain; charset="UTF-8" On Wed, Jan 13, 2021 at 1:34 PM Marco Pivetta wrote: > On Sun, Jan 10, 2021 at 2:48 AM G. P. B. wrote: > >> Just to clarify this raises an E_DEPRECATED right? >> Could it make sense to raise E_USER_DEPRECATED instead? >> > > I hadn't checked this before, but as per George's message, this is > worrying. > > I've been quite loud about it in the past, but static metadata definitions > should really not lead to runtime side-effects, especially if not pure > (error handling system tripped here). > > I'd be totally for a built-in `#[Deprecated]` attribute if it did **NOT** > have a runtime behavior, which is an absolute no-go from my PoV. > > This stuff is easily introspectible via tools like phpstan, psalm, phan, > and does not need to lead to more problematic runtime issues. > I get where you are coming from, but side-effect based notices/deprecations is just the way PHP works at the moment and as such this existing mechanism should be used and extended. I do have (vague) plans to tackle alternative ways to process notices/deprecations in the future, but this is independent from that and #[Deprecated] would automatically tie into a change of this kind. > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ > > --0000000000004d50ca05b8c7899f--