Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121759 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 65521 invoked from network); 22 Nov 2023 17:08:25 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Nov 2023 17:08:25 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3452C18004D for ; Wed, 22 Nov 2023 09:08:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-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,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (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 ; Wed, 22 Nov 2023 09:08:28 -0800 (PST) Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-280351c32afso25372a91.1 for ; Wed, 22 Nov 2023 09:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700672904; x=1701277704; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=MEbXX8FoaFET9MCC7bSmbpyqBRHy6M0BM603X3wHIZM=; b=OuPnyJj30eGrinLAuZz4f3UlvRm7hBYSas9y4Q2cnHaMGL37o/Ea3T4xFjaOWyvFln OYwSl4AIP2TLEvF1fYH3LGJXZDPDHFbIqOd69W5FQhaugzxDIRI/+TeC3mQDFQZcxZ7a GbG3A/r1XIv9UoDMRd+8oxxLgHcFPt/iuzRtCiA7kUMxantkxngAXR2GP8Iy/cWXQXkG /Zab8f99RxS0vcqB7ebvLSMG2wCAR4JI0EzVZwEEtilVFAPF0b2XZDBx+CadpBxz1Rnp qoQHDUn76KkIPMQixW5bkohiLY0dbuIU1Ux8QnoSixwxwzaSqWqOA7JSD0CVG2eNyWkQ /eKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700672904; x=1701277704; h=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=MEbXX8FoaFET9MCC7bSmbpyqBRHy6M0BM603X3wHIZM=; b=cNltPvWG3rJgOupJxa8S1V5vCcQoyxQ3WsahkVFB3aBSrZzqwdvy9yOWNWAEEWJ9ld v5sZDQarhJeLdct2FwtWmC/B0Lf+bPWdHY81dsCxDHsLSvL4XDjCLQhtnF6EvmpNQv9J CDMiVB8fT9Pwo3A4ODJE5Vs9PHNEZ5t8BukvS9F0lp+1SGukQSOcz/S3vxpwjUzI1lWv mBhOA+v7JXe+xwOD2wMoZI5oqeb6pon07epDruDCAcGQVbxqRxGFMxRZw6l7PE5DYxEy CoSXjRw9qYobwH5hRIRdkeamAfRRS1sG2+3Lcm5kc8YPrydYOaAOnY3Lp9gnO54aTsSQ 3XiQ== X-Gm-Message-State: AOJu0YzW3hI4DcBOMyAF41+M/sslB5XPsA1T+Q4bph5yGLwzG+Q99g27 mZEuGBv1AAqESmthCzn58zHML78lCTwu2vsxmOI= X-Google-Smtp-Source: AGHT+IF1gdbirdDELdQp8VMYZ74nMKdfEXQsd/TNK1tK6zh53xNPOKaQXsxNlXwLYuy8tpK2Xstg+vT8IRuYOYFPJ9E= X-Received: by 2002:a17:90b:3803:b0:280:8cef:c87d with SMTP id mq3-20020a17090b380300b002808cefc87dmr3260516pjb.19.1700672903650; Wed, 22 Nov 2023 09:08:23 -0800 (PST) MIME-Version: 1.0 References: <04DC3709-3B46-41C0-976E-E6AB28BC0D34@edison.tech> In-Reply-To: <04DC3709-3B46-41C0-976E-E6AB28BC0D34@edison.tech> Date: Wed, 22 Nov 2023 17:08:12 +0000 Message-ID: To: Mike Schinkel Cc: Jakub Zelenka , =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= , PHP Internals List Content-Type: multipart/alternative; boundary="0000000000004d20ca060ac0c43c" Subject: Re: [PHP-DEV] [RFC] [Discussion] Resource to object conversion From: george.banyard@gmail.com ("G. P. B.") --0000000000004d20ca060ac0c43c Content-Type: text/plain; charset="UTF-8" On Wed, 22 Nov 2023 at 07:36, Mike Schinkel wrote: > On Nov 21, 2023 at 11:33 PM, > wrote: > > What is the point of a major release if we cannot even do such a BC break? > We don't even know when PHP 9.0 is going to happen yet. > > > I have been using Go for about four years now and it seems they have > gotten the backward compatibility issue nailed, and that pays great > dividends in developer confidence in the language, i.e.: > > > https://www.reddit.com/r/golang/comments/17v4xja/anyone_face_issues_when_updating_version_of_go/ > > They recently explained in depth how they do it: > > https://go.dev/blog/compat > > Also see: > > https://thenewstack.io/how-golang-evolves-without-breaking-programs/ > > Although Go is compiled and PHP is not, I think there still may be > significant insight that can be gained for PHP by studying how Go is > handling it and applying any lessons learned. > Go is a "new" programming language, with its 1.0.0 version being from 2012. It was also designed from the ground up. PHP on the other hand wasn't designed, but the language grew organically, and is 28 years old. Comparing it to Go, in my opinion, makes no sense. We should be comparing ourselves to languages of that age or older, the most famous example being Python, which did a major BC break between its version 2 and 3. But Fortran, C, Perl (with Raku), and for sure others have all made changes to the language, recent or not, that break compatibility. Go even has a cave out that they *may* release a Go 2 specification, which does not guarantee any backwards compatibility with Go 1. [1] Even if the current lead engineer says this is "never" going to happen, the cave out still exists. More importantly, it is possible to write cross compatible code, even without changing anything about is_resource(), if we convert streams to opaque objects. It might be tedious and one might need to have redundant instanceof checks with is_resource() if one does not want to check for a false return, or duplicate checks for closed resources. But it is possible, which was *not* the case for Python 2 and 3 as it changed fundamentally how strings behaved. Finally, I think people would have more confidence in the language if it stopped coming with various foot guns included that need to be explicitly kept in check by using external tools such as static analysis tools, or code style tools. And removing those, or making the language overall more coherent and consistent, requires us to break backwards compatibility. Sincerely, Gina P. Banyard [1] https://go.dev/doc/go1compat: > It is intended that programs written to the Go 1 specification will > continue to compile and run correctly, unchanged, over the lifetime of that > specification. At some indefinite point, a Go 2 specification may arise, > but until that time, Go programs that work today should continue to work > even as future "point" releases of Go 1 arise (Go 1.1, Go 1.2, etc.). --0000000000004d20ca060ac0c43c--