Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110061 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 78089 invoked from network); 7 May 2020 10:19:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 May 2020 10:19:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E8E1E1804F2 for ; Thu, 7 May 2020 01:54:32 -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=-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-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (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:54:32 -0700 (PDT) Received: by mail-il1-f172.google.com with SMTP id f82so4563929ilh.8 for ; Thu, 07 May 2020 01:54:32 -0700 (PDT) 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 :cc; bh=0ghfd/hoxbf62uLQ4SVGc4wqZJhTZ40/fu8WQgqotcA=; b=X2ALzY1b4MiTX0R26BEtvU1Kz25QLuNU2uI0YVYBOBFRTi7SqM5hNseAEaM9+Jqdoi FssMpb7fFW7BEnYP2tNhpFpwLGro8fmCPv0ob02q3BME72+8nO7LIYzLVYJxSFztfvcn ok4NCjH0gHIhmY/OhJco0+79Pc4mSoAKRISTz0z965peMuI+/wuaEttafKmGxNR82+Sr 29dK68W2lSshF6ZzkSzJeT9SzZ+FTkTvLNkThw6FV0U4Y241ZWLMPGWXzc4F2DLmk4iC yxtaoYUIGJSGGnu/tJeC7wsT4FBQTpbY4Djy0/KpsxQJ2Y0tgTZ/5wohWJz3/IdH3m88 o0KA== 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=0ghfd/hoxbf62uLQ4SVGc4wqZJhTZ40/fu8WQgqotcA=; b=rDbTInaHxnFvrCAJtycovtZ2f69GpqZHVeB1T5txXsfH79YcV2ILmimidIEG3xYlay ucmnLr2mqalT5FQNyrsGudnzsNnQjBk5IOaF26DF8aL2Sh905TFyyPOxNb0Al15Q4ldd 9WTtMzlIoMS4gheg+ddUFeJGCc4XzWrdFcOEsSEL+UAhBmjJzzjHW9bUfAYElKsowccd M8Pqyj8ZTo40eRfGnv18SoCfSB1QTEoVB8xdSoxMadYJCS3P/M1YnGkglSeTNEBAhfSZ sH0kPNcTLdkg+Gc5mwV9YdIA5Jac+tP74OopkCvFuzvD6d4gou8t31//bj64JLqiNVx0 WEVg== X-Gm-Message-State: AGi0Pubx29PngXu//YcXfTcJ4r1JfyAwkwfG8N73Qto05zFd6EjyVY39 dOWPyUYLKyb7UB9rRqj+HlMHoMIjAPyXaUX4dSyL9AuS X-Google-Smtp-Source: APiQypLHD7eyDu3vrk4l0q1W3ixbNUV1QkHfgDAX5Hz2HguoJ3p2D5TInDkTytr/0VUMKrkZdIEUIsLymXiboYPycbs= X-Received: by 2002:a92:cc4a:: with SMTP id t10mr13534574ilq.292.1588841671253; Thu, 07 May 2020 01:54:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 7 May 2020 10:54:19 +0200 Message-ID: To: Benjamin Eberlei Cc: Davey Shafik , PHP Internals Content-Type: multipart/alternative; boundary="0000000000006b669705a50b0748" Subject: Re: [PHP-DEV] [RFC] <> Attribute From: ocramius@gmail.com (Marco Pivetta) --0000000000006b669705a50b0748 Content-Type: text/plain; charset="UTF-8" Hey Benjamin, On Thu, May 7, 2020, 10:42 Benjamin Eberlei wrote: > > This attribute is "reflected" by the engine during compilation, userland > doesn't have to reflect it again itself. on a code level the engine > "patches" each function automatically, this would do the following at > compile time: > > @@ -1,6 +1,6 @@ > > -<> > function foo() { > + trigger_error('Function foo() is deprecated', E_USER_DEPRECATED); > return 'foo'; > } > Already discussed it elsewhere, but I don't think that adding more runtime side-effects, especially on otherwise referentially transparent code, is a good idea. Very much against the current wave on `@trigger_error()` wave that symfony introduced. The rationale behind that hacky/messy approach is that sometimes deprecations are not determined statically (for example, if a specific parameter **value** is given), but I see no reason to do the same for static references. Since this would declare deprecations on static symbols, it can be detected statically, not at runtime. You will also get deprecations for very deeply nested components, which are transitive dependencies of what you effectively use in your sources: seen that in the wild already, and it wasn't a fun ride either. If you still want warnings at runtime, you can plug in something like GO-AOP-PHP, which kinda does exactly the same thing, but opt-in and not as a standardized side-effects engine (bad). Very similar PoV of Davey: since recently, we have the static analysis tools; let's endorse static analysis instead. > --0000000000006b669705a50b0748--