Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107500 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 73361 invoked from network); 11 Oct 2019 14:05:55 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 11 Oct 2019 14:05:55 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 0A7F82D203B for ; Fri, 11 Oct 2019 04:49:04 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Fri, 11 Oct 2019 04:49:03 -0700 (PDT) Received: by mail-qk1-x732.google.com with SMTP id w2so8599711qkf.2 for ; Fri, 11 Oct 2019 04:49:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dqxtech-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V6yZPMz9FUIy9GpMwVB6UiyDP4Plbx68rXUh1gB+X9M=; b=V+8vPbVC4gPr86nqL1n7UbNB2mHDSUvL4o11L0onReXsADCsDqFeUESmnZw5SgsMuZ TI8Z4vSRQQmNdC2ReY3QBLJO8afNQF4Ld6RMf7eVaUG6OogrwbDGIeyiZD35T6xnaYA0 b0umh8Tqw+eeSaMpjymBv2+cSTt7N4mFDF68hCIELGRGhD2qWm+Md3wuZvwAQ3Tla5f4 IVmYDcFhRjmNtAb1dOH1WiDqNGZz5Vt7sfUwUmBxm0USnzeKSe1eyIucRsjK4l8vFpV9 /z8eGa4fddINsCFmpKzvRsIh0xlBO7YFy8ILQoGuIX/sfIqPR1E9/yeQmn29F3lBC2ND kqCg== 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=V6yZPMz9FUIy9GpMwVB6UiyDP4Plbx68rXUh1gB+X9M=; b=FtPjpZcbdpGCdnxSkj+wM4xJd4xEl5vzC41vdym+RQcwWbhUOkMQhy5hRNnWc3Aex9 eqaUTknUoYi3UVo326NZUkLnEj/CjDRunDA0xdfAXzecmjYGrxpEXj4kPpINVITODr1p DuiKjy5+HOl+bxg6EODaXZtschFyS06M548L3mDeSrT4pmG8HN4bz7Q06mNdcUkiFsax ZS58bzqQh9YdYr3XbwVgXOJbDU2cUz6CV4Wbmu4dU3TiP0VifQ95Cb5URhhPUsuRvSyG GzcgVqc692Swv8vnZvuCgOVhsIFqmZwuNBo9Vs1hySzTNi8uSuOlbALDS2tunHcwcPrc zdpg== X-Gm-Message-State: APjAAAXstJ6DQmqEJzMzfh5k50Zf4nI6F6+vst6BrIRiTL5gTG6H7Nv6 8vVUoAX97v5cAAF/gCz0aSMyYKrT19E= X-Google-Smtp-Source: APXvYqxlVjkg3upuYJpOJQrWPXzCMl3Mw0Gtz1qRzY2AC/n1SKSsq9CmEWHq05FqySviSU4nBfBd9w== X-Received: by 2002:ae9:f003:: with SMTP id l3mr15047923qkg.59.1570794542791; Fri, 11 Oct 2019 04:49:02 -0700 (PDT) Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com. [209.85.160.181]) by smtp.googlemail.com with ESMTPSA id a19sm5430159qtc.58.2019.10.11.04.49.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Oct 2019 04:49:02 -0700 (PDT) Received: by mail-qt1-f181.google.com with SMTP id w14so13384443qto.9 for ; Fri, 11 Oct 2019 04:49:02 -0700 (PDT) X-Received: by 2002:a05:6214:1887:: with SMTP id cx7mr15569587qvb.123.1570794541666; Fri, 11 Oct 2019 04:49:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 11 Oct 2019 13:48:50 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset="UTF-8" X-Envelope-From: Subject: Re: [PHP-DEV] Migration tooling and the cumulative cost of purely syntactical deprecations From: andreas@dqxtech.net (Andreas Hennings) On Fri, 11 Oct 2019 at 12:25, Nikita Popov wrote: > > Hi internals, > > One thing that I feel gets lost when discussion is spread over multiple > proposals is the following fact: > > Purely syntactical deprecations, such as the recently discussed case of > backticks, but also the already accepted deprecations of the "alternative > array access syntax" and the (real) cast, can be performed automatically > and with perfect reliability. > > Given a high-quality migration tool, the cost is running "php-migrate.phar > dir/" and importantly (and this is the point I want to make) this cost is > constant regardless of how many different things get deprecated. For this > kind of tooling, it makes no difference whether it only has to replace the > alternative array access syntax, or whether it also needs to replace > backticks, some obscure variable interpolation syntax, or whatever else we > want it to. > > As long as the deprecation is purely syntactical, this kind of migration > tooling is reliable -- this certainly does not apply to all deprecations! > For example, the also recently discussed case of undefined variables is not > something that can be reliably migrated in an automated way (at least not > while producing idiomatic code). > > Rather than starting a holy war over every single RFC that contains the > word "deprecation", I think we should take a look at our migration story > and possibly invest some effort into creating a "blessed" tool for this > purpose: One that only performs migrations that are completely safe and > should be runnable without fear of breaking code. > > I do realize that there is already quite a bit of existing tooling, things > like Rector, various CS fixers and compatibility scanners, but I don't > think that we have anything that just works out of the box to do what is > safe and no more. > > If we provide this kind of tooling, I think that the cost/benefit > calculation on deprecation changes: If we have any syntactic deprecations > at all, then it basically doesn't matter how many different (syntactical) > things get deprecated in one release, the migration cost is always going to > be the same. (This is of course a slightly simplified view, but close > enough.) This does not really take 3rd party code into account. (composer packages, wordpress plugins..) What I could imagine is to let the package manager (e.g. composer) or the package distribution portal (e.g. packagist) apply these automated fixes to legacy packages and provide cleaned-up variations. An "application developer" should not run clean-up scripts on 3rd party code, unless this is automated and happens each time the 3rd party code is updated. And we should not assume that every 3rd party package author will take the time to update their package. > > Nikita