Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123598 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 B40601A009C for ; Fri, 14 Jun 2024 04:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718339911; bh=ehX7jQxeNy3E8MTyvkbl26c8lGozwmxPRlmiSJCb/WY=; h=References:In-Reply-To:From:Date:Subject:Cc:From; b=RGWEoanSuarjnF78myC2Co8kXuP47vxA1bNpu6YxilmlEkGHCrknV9etr1bdD2Ii1 SBvq3SCzNdSg2cRUS+jwWQIVyUgrpPxyczB8gTZ0dzrB6+1sgGQ5frIFmkb8zQlK4f e/MpruuoN8pMRIkGV1jfkfak97GI+gUsCpZCwYQ7Npbnrl9up2qTIWs1Xg0Gnllegq K944XBXS19aVTKXxZuO70UUQmsQHKu7n1VAQt+yTTioxvnp7siGDKvlfLpTBEvoooR MiM3zduuryoeUIaXv1xpbfeeaGqLyz0L8bVzY2+f0lOql4cZmci1+21Jq7g5DfkJw/ JJzuHSkfdYLPA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3796F180050 for ; Fri, 14 Jun 2024 04:38:29 +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=1.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, MISSING_HEADERS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 ; Fri, 14 Jun 2024 04:38:28 +0000 (UTC) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-421b9068274so17030585e9.1 for ; Thu, 13 Jun 2024 21:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718339838; x=1718944638; darn=lists.php.net; h=content-transfer-encoding:cc:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ehX7jQxeNy3E8MTyvkbl26c8lGozwmxPRlmiSJCb/WY=; b=kz/1OZeamBfdQEgtDt2HKeYM2AYMWGF9Q51xYGQBYVBQB0oHH4uBzUIEoPLZAPxgCC XnBIcwY4541lJu+qudCmkukNbtYfiPrf2Fp1VVv+wY+iM0QQcUTC92DG8627WEUR8SM9 8NXGObbXQjXR4oJDOWTCaIBLTH6swxNuYoDo3EHaukrKfZuTSepJ6BOBgzrk3AevHXJp tbzqfe4W91tP2BzNxXfSwCGbN30vmv6ZtHQXWFKNZVOBoZ7sQMXy3PF8CwdXiXoq9X2m gLpknK3MXI6e3gENrUrjlXTuhXeUV0fGhhOVsdCMuHlQ2w9U7qFimpk5dx72ItZRSSUN 4dXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718339838; x=1718944638; h=content-transfer-encoding:cc: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=ehX7jQxeNy3E8MTyvkbl26c8lGozwmxPRlmiSJCb/WY=; b=imYCXVgu0P8BUZkMoUHV8Vht1X/4BPlcM+HsOkG8Sk5pcaRdcN45JVuPZ+d9HUF5QB rhBDFSQHMsku6snpSDBX11aeqBl3ZbYELOHMr67BmvObff342SjkgqUkktJnbyEmjydD A8MaZdPbV55FU1Us8Omy2lsLCcdtmZN5fexUTs/AiGext6a6FUcxiDceLfZDVB0km0ne 3B3Y1l12dreqtpMuKcEx4xW9n17NeYxsdhPsUeMUA1NiseD8fo/3maHc1+oZ0Ug5Us0h Q0pAzJps5ksAh7XQCPGXVmO7GSRw9ZgB4JhDKNOFhw5BCOewvpPu/bW8jYfvAmShXmyB a14Q== X-Gm-Message-State: AOJu0YwvquLikUgWJ2RDNnWoBr2kwG4230AfOJCDscpKJTY842v6WHoC 53qWvffliM52lZvxSFGwqwElRSNkSkYobjgapO9hKERCkBC+c2n6fS+HobjrZUZGX7mAtojJuoI ocRNKjCakVD+Pvwiu1ZZrNIfuxHaD+KRN X-Google-Smtp-Source: AGHT+IFEvUrDyXi2fCt0QvSserHFd6F+4CkPQr6YsssBvVyoVsQDK6nRpHbTsk3VYXSR/A8MnSkznzegvcgjBCuWS5Q= X-Received: by 2002:a5d:5257:0:b0:35f:1b75:c3d0 with SMTP id ffacd0b85a97d-3607a76263fmr1131575f8f.22.1718339837697; Thu, 13 Jun 2024 21:37:17 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 14 Jun 2024 07:37:02 +0300 Message-ID: Subject: Re: [PHP-DEV] Revisiting case-sensitivity in PHP Cc: php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: raveren@gmail.com (=?UTF-8?Q?Rokas_=C5=A0leinius?=) I'm no one important, but I just want to say for the sake of the public image of PHP I hope this does not pass, or at least not in the foreseeable future. There are NO substantial gains to speak of here and the BC break is real and it's super annoying when they pile up and up. Besides, this is slightly off topic, but I don't know if you know, but if you take a look at stackoverflow developer survey over the years, there has been an absolute 30% drop of php popularity in the past few years. I would guess this is mostly the low-level developers not being fans of the language removing magic quotes and other "super useful" features. In other words, PHP lost the average joe as its target audience. Joe's gone. Just my 2=C2=A2: a) this WAS the reason PHP was great and I loved to rewrite the systems of several very successful companies who started out with their non-technical founders who coded their way out of the box to begin multi-million businesses b) the PHP core and co. (a.k.a. YOU) should be acutely aware that the language needs to be liked by not only you, dear awesome lovely hardcore nerds, but also the users who just need to get stuff done, business needs fulfilled. I know this is not how YOU work, but if you ignore that part of the language users, there might eventually not be a language to work on in the future. So please, keep the language loose, I hate the slight inconsistency too, but if we ruin the day for another 20% of users, it might even be the straw that broke the camel's back. On Fri, 14 Jun 2024 at 02:38, Valentin Udaltsov wrote: > > On Friday, 14 June, 2024=E2=80=AF=D0=B3. at 00:04, Timo Tijhof wrote: >> >> Would this affect unserialize()? >> >> I ask because MediaWiki's main "text" database table is an immutable/app= end-only store where we store the text of each page revision since ~2004. I= t is stored as serialised blobs of a value class. There have been a number = of different implementations over the past twenty years of Wikipedia's exis= tence (plain text, gzip-compressed, diff-compressed, etc.). >> >> When we adopted modern autoloading in MediaWiki, we quickly found that b= lobs originally serialized by PHP 4 actually encoded the class in lowercase= , regardless of the casing in source code. >> >> From https://3v4l.org/jl0et: >>> >>> class ConcatenatedGzipHistoryBlob {=E2=80=A6} >>> print serialize($blob); >>> # PHP 4.x: O:27:"concatenatedgziphistoryblob":=E2=80=A6 >>> # PHP 5/7/8: O:27:"ConcatenatedGzipHistoryBlob":=E2=80=A6 >> >> >> It is of course the application's responsibility to load these classes, = but, it is arguably PHP's responsiblity to be able to construct what it ser= ialized. I suppose anything is possible when announced as a breaking change= for PHP 9.0. I wanted to share this as something to take into consideratio= n as part of the impact. Potentially worthy of additional communicating, or= perhaps worth supporting separately. >> >> -- >> Timo Tijhof, >> Principal Engineer, >> Wikimedia Foundation. >> https://timotijhof.net/ >> > > Hi, Timo! > > Thank you very much for bringing up this important case. > > Here's how I see this. If PHP gets class case-sensitivity, unserializatio= n of classes with lowercase names will fail. This is because the engine wil= l start putting `MyClass` class entry with key `MyClass` (not `myclass`) in= to the loaded classes table and serialization will not be able to find it a= s `myclass`. > Even if some deprecation layer is introduced (that puts both `myclass` an= d `MyClass` keys into the table), you will first have a ton of notices and = then eventually end up with the same problem, when transition to case sensi= tivity is complete. Hence I propose no deprecation layer =E2=80=94 it does = not really help. > > However, you will be able to use `class_alias()` to solve your issue. If = classes are case-sensitive, `class_alias(MyClass::class, 'myclass');` shoul= d work, since MyClass !=3D myclass anymore. And serialization works perfect= ly with class aliases, see https://3v4l.org/1n1as . > > -- > Valentin Udaltsov >