Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125794 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 12C0F1A00BD for ; Mon, 14 Oct 2024 02:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1728873624; bh=hS5n7ojzkmz0DZmV8rh403gyU/qH8tcP8sQNn9naVes=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RbdOrZfygqgnYnS+cg0JsPrjPnQ9VBWI8wFH5hy/5QT+PNK9cgd5kk/969ChBX2C6 /attXdUSi/gDqTpLmH2c4JfPb+WywU28p+i/tKZTIf7t6wXbvZbuZfy0mFajYPwPSj cuZ0QVnStmM7dLkaBtlPj/Ve3KSpVQxgZXSGopBRzu9APRUAXyn0omEFSWjicnYMFI DmSiRWtBd9SM3KVx5LSNGNElYKQKmnnkPamuM043B371Wb0qFCInJn0OL7CuUnbcMW eFCVt779YEusVUkYIXi803Tp25/DAw8+fSFkQfntcN9vbEl4SRk/FBm/XPkYzGsVtQ /sUEijtuRP+rA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D6DB418004F for ; Mon, 14 Oct 2024 02:40:23 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 ; Mon, 14 Oct 2024 02:40:23 +0000 (UTC) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4305724c12eso28300755e9.1 for ; Sun, 13 Oct 2024 19:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728873482; x=1729478282; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hS5n7ojzkmz0DZmV8rh403gyU/qH8tcP8sQNn9naVes=; b=QmVgGzsjrHWDcjqJg7p0SyCzg7EWocEl5xJ09FIZ7T+lUSpashA5b2fdJvsg5b4qtl mBqgQwW3I0ABKqCcw73sK9bO2F1pQbOBYQpFzMbM4n5XwhSJwVD74XCqr+4L3Z/Uefis B0wtjCKCXIFp+I4zcLljPRJwmut42kYOpIf8ksdgur4UQAHN4erdO6BQ+3PQ5vMgz5kS u5Qohogc0iihU1/KIGp2QhNZSlmB46Oo3newb3w2iGKsqWPX0qaGxW4aF/74PGryKfFA iXP3BqYFDzS5FjTtA7heCdieOdrJMaRIpiIGFOrrGeFAUC9tiFauBOH4tJJIh1LnctSn bvhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728873482; x=1729478282; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hS5n7ojzkmz0DZmV8rh403gyU/qH8tcP8sQNn9naVes=; b=Dpuc3ycAw3GmfGAAhF7FbvSKAZL5CsIx6W152a50nVoD3IG9ueKUC6KiSSDDOAHg3t 1Fzx2wdoVUM+Kb5QfRRQOqcyfsiO//7CxMT93vAbhY/uSIvHQ0/GfhwTUNACBQf/3iqH hGF3Xaw4H7GDxe8h8gcKbU7weP5H7qID6pgCYiQVEMjbCnBBN60ljDnaJhZwfW+yG6f6 v0o4dWRzvNQpeSEkd8pzGeB8Qn4qWBDFhR3PCBM/JCIcDyfzBLsSEZ14rkLdRtyzD3TS Agyj79lj6v7pv764EvtRVY7DkD59Mtii5n++SBeg5OSgPiOD/jOyfE++q9QyESn/y7iz YM6g== X-Forwarded-Encrypted: i=1; AJvYcCWnbqjRohrX3YQZwzREyq7OwT2iziGLPoRxejaPpD5ew7KjZuIJEagTK72FAicZQc3QNcCIMr0/6DQ=@lists.php.net X-Gm-Message-State: AOJu0Yz8zZY7GcrHYCVrWfFQEUgbOXxJsUDCAGaERHTtXmiD7d79F/H8 ZBwXJgN/fwMJ44Gq+NFjZ3d1G3iMPc+Alaj8r4iDPz2p7cjip+sX8C8SGPBWr/md6MN8Sn14E0/ tnSPv96tu045MwmkJ+puRdFqEsw== X-Google-Smtp-Source: AGHT+IFEFqgnjhkqw2q3HZkXnFW0E57tbafdyMBC55mD2hbA2tI6g6mD3d6hKFz36opK1ueKxKkoZHDtRZu8xFP1dn8= X-Received: by 2002:a05:600c:5111:b0:431:1575:2e83 with SMTP id 5b1f17b1804b1-431255dc891mr57861475e9.10.1728873482149; Sun, 13 Oct 2024 19:38:02 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <2A7CF24F-3AE3-4125-965F-C65431C42DFB@gmail.com> <30a41608-a1ea-40a9-8d2a-c53c508cd89f@jnvsor.net> In-Reply-To: Date: Mon, 14 Oct 2024 05:37:50 +0300 Message-ID: Subject: Re: [PHP-DEV] Asymmetric visibility is a BC break To: Jordan LeDoux Cc: Rob Landers , internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: udaltsov.valentin@gmail.com (Valentin Udaltsov) On Mon, 14/10/2024=E2=80=AF05:01, Jordan LeDoux : > > > > On Sun, Oct 13, 2024 at 5:03=E2=80=AFPM Valentin Udaltsov wrote: >> >> On Mon, 14 Oct 2024=E2=80=AFat 01:28, Jordan LeDoux : >> > Backwards compatible has never, in any work I've done through my entir= e career, meant something like "if you take old code and then update it to = the new version incorrectly, it doesn't work"... that seems... obvious? >> > >> > What exactly is the claim being made here? Because it sounds like the = claim is very much that second "definition". >> > >> > Jordan >> >> Hi, Jordan! >> >> The problem is that in practice most of the PHP libraries consider >> themselves to be compatible with newer PHP versions. >> >> For instance, Symfony PropertyInfo uses `"php": ">=3D8.2"` constraint in >> its `composer.json`. However, it is not compatible with PHP 8.4, I've >> just created an issue: https://github.com/symfony/symfony/issues/58556 >> >> The end user will be the victim, because `composer require >> symfony/property-info` will happily install property-info v7.1.4 for >> PHP 8.4, but it's not gonna work. >> >> -- >> Valentin > > > How does a library that uses code that will not even compile (like `reado= nly` or `private(set)`), but claims to not require a PHP version that uses = the syntax, suddenly make a BC problem for the language? Composer allows li= braries to set minimum PHP versions for releases. Any time you update your = libraries, you may have to update your code which uses it. That's just part= of how libraries work. > > Jordan First of all, I have already agreed above that PHP does not have a BC break here. Now we are discussing the potential problems in the PHP ecosystem and how they could be mitigated. > Composer allows libraries to set minimum PHP versions for releases. I think you've got the problem wrong. The problem is about the maximum version, not the minimum one. Consider the Symfony issue I've just reported: https://github.com/symfony/symfony/issues/58556 Symfony PropertyInfo requires `php >=3D 8.2`. And it is written in PHP 8.2 syntax. So it can be safely installed and used in PHP 8.2 and 8.3. In other words it's forward compatible. However, the `php >=3D 8.2` constraint also allows installing it in PHP 8.4. And as it turned out, PropertyInfo is not ready for 8.4 syntax (see my reproducer https://github.com/vudaltsov/symfony-property-access-php84). In my opinion, this is a problem, because a PHP 8.4 user can install the library without any obstacles and only later find out that `private (set)` properties do not work as expected there. Ideally `symfony/property-info` should not be installable until it ensures to be compatible with all the PHP 8.4 features. So, its PHP constraint should be `>=3D8.2 && <8.4`. And then `>=3D8.2 && <8.5`, once the tests pass for PHP 8.4 features. -- Best regards, Valentin