Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123400 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id A554E1A009C for ; Wed, 22 May 2024 08:00:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1716364888; bh=nVWWE05aQy2HBOwyGvToZW2SOa6gk6gUsm5rpFKXj04=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=abmkw3VuOIP+/AYMVnyc/u35k9m/P+3k0NCODCunKY8+TYn2p3rog0yACsa1hk4kc EOpIMehX8o460109LVympLxcK92YW3bLLsGlA0s869xbQEKjVMGQEY8LJ3t5xArsBV DAdqh2PrDbYapiDeSanSdwOoZf3w7Yf91nqmV5YtdLnV5YdbTpQUASeBvE9xulmYjY zzfjAYyjRnPGiZhuFUjQEK3LKTAmBwd4zbvg5RqvGJBm5i2nsDpeG/4cwz9JxaWxD4 zHfpsLNz8AJ21FZJiuXHy9q1PItsZb0UC2hz1txQPo9EZOQre0bDf3Yn+/qSyCS/Iq 8e/IlDQXvijXQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0665D180669 for ; Wed, 22 May 2024 08:01:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from smtp-bc08.mail.infomaniak.ch (smtp-bc08.mail.infomaniak.ch [45.157.188.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 22 May 2024 08:01:26 +0000 (UTC) Received: from smtp-4-0000.mail.infomaniak.ch (smtp-4-0000.mail.infomaniak.ch [10.7.10.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4VkkHw6DwrzmkW; Wed, 22 May 2024 10:00:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=processus.org; s=20231208; t=1716364828; bh=KaHHdmFKGGr99EU+D/pZvVcxcFDyh55/n/rsilTl2T4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=0RVDcnOf9h3m8rf8CdzPIsBJYA/RqCoWFJNG2C3TYAKOQs6DuSfdaI3zvebaH9yMX 9lTpAdqwvNmJFU3i3UKjCum+EKXT1SJuRt/gp448R+PyDljYUbbYjPNgtlMsmjTVCQ lUM+j3RzyNz7yRZdVmzoZAh7AqNqCfONJ7V/WyBQtlK5XFMu/zKHvhY9p1/noMRbu7 g2VDc4Kv2Dp/yp+rZgStapUWUP3XRFU0NLdex1ECmXchJD6MvoIc0bEIZ3U+OKnCJM H5LAION2y4trqe+vQ8/iUwCNEy/EJ6ZhLsrihZJBSJkpLq7M3rZZeRVTeARYvvah4U HxpLB3OI/Ol6A== Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4VkkHv4rPZzYN2; Wed, 22 May 2024 10:00:27 +0200 (CEST) Content-Type: multipart/alternative; boundary="------------K5SYDt0Mq3CwBD09Jk0Y3xRC" Message-ID: Date: Wed, 22 May 2024 10:00:26 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] [Vote] #[\Deprecated] attribute To: Nicolas Grekas , =?UTF-8?Q?Benjamin_Au=C3=9Fenhofer?= Cc: PHP Internals References: Content-Language: fr-FR, en-US In-Reply-To: X-Infomaniak-Routing: alpha From: pierre-php@processus.org (Pierre) This is a multi-part message in MIME format. --------------K5SYDt0Mq3CwBD09Jk0Y3xRC Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 22/05/2024 à 09:33, Nicolas Grekas a écrit : > Hi Benjamin, > > The vote for the RFC #[\Deprecated] attribute is now open: > > https://wiki.php.net/rfc/deprecated_attribute > > Voting will close on Wednesday 5th June, 08:00 GMT. > > > I voted "no" because I think this is better addressed in userland, as > this gives more flexibility. > I would better have an attribute that is made only for static analysis > with no runtime side effects at all. > Being forced to make the attribute final because the implementation in > the engine requires is an example of why the engine is not the correct > place to send this notice. Another example is not being able to add > the attribute on classes because [engine reasons]. > > trigger_error() is better fitted for the runtime side-effect when it's > desired. > In my opinion, #[Deprecated] should be only for static analysers / > reflection (although this would need another discussion - I'm not sure > this would benefit being in the engine vs in a userland package. > > Thanks for the RFC anyway. > > Nicolas I'm always dubious when I read the "this can be addressed or better addressed in userland": as soon as you need something as little as the Deprecated attribute, if it's not in core but in userland, you encounter two very serious issues: first one, fragmentation, every framework, organisation, or static analysis tool will have its own variant, second one if the community converges toward a single one, you then will be dependent on a certain framework or huge tooling. I can see many benefits in having this in core, one being that every static analyzer will implement it using the core attribute, so any project and developer using it can choose any static analysis tooling without having to change or adapt its code everywhere, or learning a different convention in order to use different tools. That's my 2 cents, but the "better in userland" argument seems to me almost always biased or wrong. Especially for this Deprecated argument, this a very common need, and each project Doctrine, Symfony, any tool implement it in a different manner. I don't want to be rude, but as a developer using all of those, it's very annoying having to learn different ways of doing something as simple and naive that saying that a function is deprecated. One manner is sufficient, even if not perfect. -- Pierre --------------K5SYDt0Mq3CwBD09Jk0Y3xRC Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Le 22/05/2024 à 09:33, Nicolas Grekas a écrit :
Hi Benjamin,

The vote for the RFC #[\Deprecated] attribute is now open:

https://wiki.php.net/rfc/deprecated_attribute

Voting will close on Wednesday 5th June, 08:00 GMT.

I voted "no" because I think this is better addressed in userland, as this gives more flexibility.
I would better have an attribute that is made only for static analysis with no runtime side effects at all.
Being forced to make the attribute final because the implementation in the engine requires is an example of why the engine is not the correct place to send this notice. Another example is not being able to add the attribute on classes because [engine reasons].

trigger_error() is better fitted for the runtime side-effect when it's desired.
In my opinion, #[Deprecated] should be only for static analysers / reflection (although this would need another discussion - I'm not sure this would benefit being in the engine vs in a userland package.

Thanks for the RFC anyway.

Nicolas

I'm always dubious when I read the "this can be addressed or better addressed in userland": as soon as you need something as little as the Deprecated attribute, if it's not in core but in userland, you encounter two very serious issues: first one, fragmentation, every framework, organisation, or static analysis tool will have its own variant, second one if the community converges toward a single one, you then will be dependent on a certain framework or huge tooling.

I can see many benefits in having this in core, one being that every static analyzer will implement it using the core attribute, so any project and developer using it can choose any static analysis tooling without having to change or adapt its code everywhere, or learning a different convention in order to use different tools.

That's my 2 cents, but the "better in userland" argument seems to me almost always biased or wrong. Especially for this Deprecated argument, this a very common need, and each project Doctrine, Symfony, any tool implement it in a different manner. I don't want to be rude, but as a developer using all of those, it's very annoying having to learn different ways of doing something as simple and naive that saying that a function is deprecated. One manner is sufficient, even if not perfect.

--

Pierre

--------------K5SYDt0Mq3CwBD09Jk0Y3xRC--