Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106512 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 27492 invoked from network); 10 Aug 2019 00:30:25 -0000 Received: from unknown (HELO mail-ot1-f44.google.com) (209.85.210.44) by pb1.pair.com with SMTP; 10 Aug 2019 00:30:25 -0000 Received: by mail-ot1-f44.google.com with SMTP id n5so138305359otk.1 for ; Fri, 09 Aug 2019 14:57:55 -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=y+Gszd4V1scbZtpE6Nf2AX2PKGkjvr5YxShHoKCG4aQ=; b=i0r9RWFwPwJd8QewKG7SAYKEy/hfvT8nJQ6Gz23iusfHXLo11uG86J6qYkk7l+SMVv 2K8rCAs7oBr49b3p9m1pDDnmiVlaIvx9N7/MYIyVZqQHiqP1TiTDq1yNIQP27Dr23Qa3 Fz5M1kBJKopoNs0/1ruiEae5ebthdEGqFlyNsL9bEAchiaaZVS4XnUBQQXnUpRNpeGHa WNFXgzdlDm7qdDp71tBucoBRj2AyLEB+z/KOXt6ydqXo/rsBMvs2QzXTzKvAxUXRIjZz EWLAJGbPyXquf+gUiswqKyhbrFgHkE0s9PalgQYf1t+GcegOIvb6R/3sk47S3Xz+CZ3s KlKQ== 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=y+Gszd4V1scbZtpE6Nf2AX2PKGkjvr5YxShHoKCG4aQ=; b=sEhW275xUfR9ZEJxZbo5G2v84ppYc/4bkFVq/vaFcIE00BFCRoOyBBUZlZtLZqfIhP Z/uXza6XC7soATKo1kbhZFv8MrlvMgKFKCljKzKuOgs18RJntVuoNrdx+C/Zmd5Iv4PJ NGGqIF5UyV8D7rbruEq1tigx1KTcEwIK5PDwkOZ3jldQDBI246m59Wl6HWgB+1t4ZGOs bi7MnPU360oxDK7+iB7J2YM1cULcmpRIF77zg6hG1umx9cKQp0aes13oMzhSTo85hG/w odvClGrpX21S8/N+9TdaopCB5QkAdImi7rnnLasJtzCwyCsk2fHn3kut8tOW+wU1ZYHJ F1eQ== X-Gm-Message-State: APjAAAXCTylOXX3JZ2w0J5zEKDf5YJRPLpuB0j0fqXqLahmw85ZkAaTV FZN5AS/Ox02uRka+t2dmHpWO03vYgXVQMF/i+bA= X-Google-Smtp-Source: APXvYqyIdNTB8MdWCJl5adBxmfE4//b0+m2sMPUGQcEPwc10n4CwSF8N8j1aYvNmAQFGatLM5fDyajjW5aS1yA7qJw8= X-Received: by 2002:a5d:8b8a:: with SMTP id p10mr1307752iol.218.1565387874969; Fri, 09 Aug 2019 14:57:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 9 Aug 2019 23:57:28 +0200 Message-ID: To: Nikita Popov Cc: Zeev Suraski , Internals Content-Type: multipart/alternative; boundary="000000000000392cf5058fb6446a" Subject: Re: [PHP-DEV] Bringing Peace to the Galaxy From: kjarli@gmail.com (Lynn) --000000000000392cf5058fb6446a Content-Type: text/plain; charset="UTF-8" On Thu, Aug 8, 2019 at 11:02 PM Nikita Popov wrote: > This is basically what I have been advocating for a while now already, > somewhat hidden between all the other noise of the "namespace-scoped > declares" thread. The model I would like to follow are Rust editions ( > https://doc.rust-lang.org/edition-guide/editions/index.html). In PHP right > now, the way to do this technically would be based on a > declare(edition=2020) in every file. I was hoping to make this a > per-package declaration instead, but haven't found the perfect way to do > this right now. > > I think that introducing this kind of concept for PHP is very, very > important. We have a long list of issues that we cannot address due to > backwards compatibility constraints and will never be able to address, on > any timescale, without having the ability of opt-in migration. > > I do plan to create an RFC on this topic. > > Nikita > Hi, After reading several replies and discussing several solutions, I'd like to add my feedback to this. Regardless of implementation details, I prefer a structure similar to the control we have over strict types. I like the idea of being able to configure this per file, or per "package" (however this may be implemented). The benefit here is that a certain file, or package, could run in fancy mode, while (possibly legacy) application code can run in classic mode. I do assume here that it's primarily behavior changes, perhaps adding/removing/deprecating functions/classes etc, or throwing exceptions instead of returning false. I expect that both would be using the same parser in this scenario. I'm not exactly sure if this will fix the backwards compatibility concerns though, at some points BC will have to broken to advance in the classic mode. Who will decide when a feature should be added in classic mode, or a behavioral change should be done? One could assume that anything that's not backwards incompatible could be added without issues. Would that mean that only "big" BC breaking changes would be added to the fancy version? Would we be looking at the removal of `==` comparisons in this fancy mode for example? Regards, Lynn van der Berg --000000000000392cf5058fb6446a--