Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119866 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46631 invoked from network); 10 Apr 2023 16:45:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Apr 2023 16:45:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 03FB41804D5 for ; Mon, 10 Apr 2023 09:45:28 -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, T_SCC_BODY_TEXT_LINE 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-yw1-f177.google.com (mail-yw1-f177.google.com [209.85.128.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 10 Apr 2023 09:45:27 -0700 (PDT) Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-54c12009c30so216217937b3.9 for ; Mon, 10 Apr 2023 09:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681145127; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fGgIX/vUlQC/M4H8YaOZUx8ngevw0dNv1upEvFE3MLg=; b=E9Psm0hVmp2qS4xgvtlnGBebyoaIFEf7pPL6HTl6k4jw1Q5I7yj5CHDf4s905NzffL 0rwZdUm1wOaUjvhGKc9E2SypTL8F1zjHCLmFflUalxnMg9gI1g5gU6rfY53FLUy2NguG DXL7a2TU3waeDMmdxKPGz1qs63DGsRJeqhIts5Ow7Nk/62Lf9BDC5hwNbDU3LnxM+6AV NlMnd2QbngBVEQIb1zTtwr1S2HZXiXdA8pkPgjOXACBqOsFBVaEVvE3l8/J+8d67Ns6x 7i0YS2hPYq4J6uu9SCdysBvABP1QMgbPx9j/QCgVTe2OL9CdGRQ465G5IfSZ7DAl24uZ uXiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681145127; 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=fGgIX/vUlQC/M4H8YaOZUx8ngevw0dNv1upEvFE3MLg=; b=qTJKs4XpY1XsWI12hCmLyjRCo/6O0aCwVWrK9T7c3pFX4sDxPi9B5zOtkbTTCZuGRP wktPrQnMbI7uXkFgwJ4WH8J/THJJoJlguS6CDvnYw7ii/ZM+xVPiIrDeBOCX+Xg+FB3A OYc70b6V8unte2pYol5Rwuj7FsOP/6dwYVU4GLVpX1We8Z7eLJijaCcfkt1rsIIgYcND ma/eWJJYTVgfUY7mlXkpEQfRnwIqUTo9iekZj37ru0KPNtlYSnNcziiCB3e0h1OKrfcX SA0nR7emFLCtXhTTAF326WcgSPVSV7ydQEIWy6O1NqfOhKTvxmRQlAntpAxb+nci8Ujl LlhQ== X-Gm-Message-State: AAQBX9eGSTyYSKzR5WN9A1iwVXHa7RZuFW31wx710j/InbtgFhDz0wqr /6cD6GmnR4JPNMOlBoKbh1KX6pBDh0Lj+ygh6Gw= X-Google-Smtp-Source: AKy350b9LvaTxJE9nOPdf77qPKbiT1jNWDH3jn0URqA8Kj4Gj8z8VTpQkDKUMnQtgK8ZTrq5MfNyrnX4DmcAl40LYjw= X-Received: by 2002:a81:4113:0:b0:54d:3afc:d503 with SMTP id o19-20020a814113000000b0054d3afcd503mr5853040ywa.8.1681145126088; Mon, 10 Apr 2023 09:45:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 10 Apr 2023 12:45:13 -0400 Message-ID: To: Jeffrey Dafoe Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000000e724305f8fe1ae2" Subject: Re: [PHP-DEV] Future stability of PHP? From: dliebner@gmail.com (Dan Liebner) --0000000000000e724305f8fe1ae2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > The change in null handling. We have a codebase that dates to 1998. It's > fairly well written. Upgrading to 8 was a major effort (4 devs, 2 QA) tha= t > took almost a year due to the change in null handling. We have 40 XML and > JSON APIs with various banks. Elements may or may not exist. The database= , > which is 45TB, has nulls all over it. And when it was all "upgraded" to r= un > on PHP8 all we really got that was useful to us is two new string > functions. And a codebase that now has ?? as every third line. This is probably my biggest stylistic gripe with PHP 8+ just because of how ubiquitous the "undefined array index" scenario is. In JavaScript: ``` let obj =3D {}; obj['undefinedkey'] =3D=3D=3D undefined; let str =3D `Welcome, ${obj['undefinedkey'] ?? 'Customer'}!`; if( obj['undefinedkey'] || $obj['undefinedkey2'] ) doSomething(); ``` In PHP: ``` $obj =3D []; ($obj['undefinedkey'] ?? null) =3D=3D=3D null; $str =3D "Welcome, " . ($obj['undefinedkey'] ?? 'Customer') . "!"; if( ( $obj['undefinedkey'] ?? null) || ($obj['undefinedkey2'] ?? null) ) doSomething(); ``` On Mon, Apr 10, 2023 at 8:35=E2=80=AFAM Jeffrey Dafoe wrot= e: > > > I wonder about this every time I hear this claim. What exactly changed > in PHP > > 8.0 that made the upgrade path so difficult? The upgrade to PHP 9 may b= e > a > > little more difficult because of some of the recent deprecations, but > that's > > still years ahead of us. So what's exactly driving people away from PHP > 8? > > Why is the adoption dwindling? > > The change in null handling. We have a codebase that dates to 1998. It's > fairly well written. Upgrading to 8 was a major effort (4 devs, 2 QA) tha= t > took almost a year due to the change in null handling. We have 40 XML and > JSON APIs with various banks. Elements may or may not exist. The database= , > which is 45TB, has nulls all over it. And when it was all "upgraded" to r= un > on PHP8 all we really got that was useful to us is two new string > functions. And a codebase that now has ?? as every third line. > > -Jeff > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --0000000000000e724305f8fe1ae2--