Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110056 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 62514 invoked from network); 7 May 2020 09:35:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 May 2020 09:35:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 777701804D3 for ; Thu, 7 May 2020 01:10:55 -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.2 required=5.0 tests=BAYES_05, HEADER_FROM_DIFFERENT_DOMAINS,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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.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 ; Thu, 7 May 2020 01:10:54 -0700 (PDT) Received: by mail-yb1-f179.google.com with SMTP id f5so2485660ybo.4 for ; Thu, 07 May 2020 01:10:54 -0700 (PDT) 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=ITcBW092rbdmAV38MZW9rc+6eKHgkvkeFESci9ZT7DQ=; b=P1LJlq6nFkYgGPqUbdnxtpI0ThzwiSjDQYIdw0qO5kybHw0GXLfdqjOLWa4l9dmXXQ fFCofWfSCHbBtK1d/maYBHjgqJXf5gT2a7XYpIVkUVoijSsVN8S04Acjawg/kyPJET8g JOKfNt7VbnQhz1KQjQCyxF2My0O2pDI2zewm/S70q0A+Cdehcqy4z07aqFzeY/rJT2pg oEzdEYoolc/C/NbmiGXHd/NfpVIFNG/+/Z8vzJHoYLHKJhK38KiEPEawk3xP3RFkftZh OcPU5JOJx0QpXGb0xMzWUaQ814dc4VooqQYLd49nBSH6fEyDhhZumFIW39+Oe1n/03Dh ikWQ== X-Gm-Message-State: AGi0PuapZsBKX3kFDBMq3kzHMHry+UKXzdms4I/Q/314PqstblS4fh9Z sjZfCqCFNJkG359cJRkM6IIgA0jydH5pvpQgulbO0txhgk0= X-Google-Smtp-Source: APiQypLEZcW8Fip1oSxQyzi9goTN4KfqH7yxuy553RiE7L/5VVnwyiUvqUwB6QOgxj5M8nXCYOE6PlZY1itzZERNAVU= X-Received: by 2002:a25:bb47:: with SMTP id b7mr18837508ybk.200.1588839054103; Thu, 07 May 2020 01:10:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 7 May 2020 01:10:42 -0700 Message-ID: To: Benjamin Eberlei Cc: PHP Internals Content-Type: multipart/alternative; boundary="0000000000006ceff205a50a6bc5" Subject: Re: [PHP-DEV] [RFC] <> Attribute From: davey@php.net (Davey Shafik) --0000000000006ceff205a50a6bc5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 7, 2020 at 00:22 Benjamin Eberlei wrote: > Hi everyone, > > The attributes RFC specifically looked into the use of attributes at the > engine/compiler level. > > To have a showcase of this with the 8.0 release I want to propose this RF= C > for a <> attribute: > > https://wiki.php.net/rfc/deprecated_attribute > > <> is the most obvious engine attribute to add at the beginni= ng > in my opinion, as > > - all other languages with Attributes/Annotations support have it as well > - its effects are quite obvious to understand, as such offer a good examp= le > and intro to attributes > - with potential property/class constant deprecation it adds something th= at > was not possible in userland before. > > Let me know what you think! > > greetings > Benjamin Hi Benjamin, Two things: 1) as a matter of course, I prefer things that can be done in userland be done in userland unless there is a clear performance or other win. This doesn't qualify for me, except that it would be possible to use the same mechanism in core, but that really only gives us the ability to reason around depredations with reflection and I don't see much value in that. I'm not entirely convinced that a PSR and a defecto implementation isn't a better solution here. This isn't a show-stopper though. 2) AFAICT you cannot add an attribute to a function argument, and the only way I can see to resolve that is to add a "DeprecatedArgument" attribute applied to the function that takes the name as the first arg (and the message as the second). Now you're looking at: <> <> function bat($foo =3D null, $bar =3D null) { } It's not great IMO. Having said that, I don't think this bit is really necessary =E2=80=94 unlike the other suggested uses, an argument isn't an i= solated thing, so much as part of the function signature as a whole and removing arguments is better done by deprecating the entire function and introducing a new version with a different name. So maybe we just don't need this? --0000000000006ceff205a50a6bc5--