Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123605 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 2BEEB1A009C for ; Fri, 14 Jun 2024 18:10:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718388682; bh=pww7B6F9C39TmyAwCfd17dmqKAh4/smTRBf68XMQPfw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=nliZlvHqCqwTrvrfYQwRztZBLlV4iq9IK3U0I3BaaytrUyjmYAbboDyOhRqiS0Zrt OTez8CE/+NYCGH6roWyznMXbUBF667h4URSGvffC5trQCV7ybXRVrFuQduX+P7pldX An7gm/LvnaV41MDaOQ1h/1rEdJ0T8dKUAIbH7yEJ05uqEf5F+SIElUcrvMidc2qC04 +tArNINnqOFJ+8Ed3B75kWxeHQL7aM2srO7pA6YE4Zs+Gptkgg5v7+6GHyey3ITZY4 98AZooLXSijaLQ4gC5jpd5FBSPcqi554Cbvw5dmxlkIfDnob1LfGnZWZejsSUq6+w8 mNM8sbY8qiONA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 91195180039 for ; Fri, 14 Jun 2024 18:11:21 +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, 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=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-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (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 18:11:21 +0000 (UTC) Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3d227b1f4f0so1271151b6e.3 for ; Fri, 14 Jun 2024 11:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718388610; x=1718993410; 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=aILosGgCT7hg+OHMiK+3kqBnZE+DdNK52nf7dTkNp1Y=; b=LuN4DQZIVLWBHxCo8RMnt3EVNtodiP0rvh7nsD2cIyFSzOqctGIUD82e9CRZx5xdm6 ezaUl4gYXNeK+NcqrysA7xg0P6zV/k8auV0KSQIj9RmL3DHZuB4VuzmzRfL/3Lzr5O8U /nzl+QhcagbDDOimEhX3rP0ZJBvEEGf/5K4wNcADcWFEIzMq2YExTEDhr6/C+/ITG5J2 8YM5Js3x+JdE/RCbJVJi2+ezSansjGkFIZPo3NJv9Lek17pNV5R2RK+uKKw6REhIxrV2 N4hphlowwVm3IB5apaG5hoxrWD8B7pKuRChZOXtoNJ0jGuLq5go4hE8bJIaVsT22wkFu i26w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718388610; x=1718993410; 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=aILosGgCT7hg+OHMiK+3kqBnZE+DdNK52nf7dTkNp1Y=; b=GBkFUjaocsZImvu5cBtEXVKOJq3hqqWrdnL8WD9Ty2N6EKqg/e64Qbz45iwqfbAESz QFIy+mQ8jaffHfUpIinrwGWNO3fxyDs947zh71/d2N0KMywyGPxkj0VhzAtcGQbru1IY F1fa8KhqATttkNXYNpvvhtpZuf5S8oOMmjd7j/xxjm6NPGGYHu8jeqP8prhnOfuGgx0N mR8oSwaEalhurIMliJ5eCfLHymL/fvTj1XDNHJNevIi3BjfGFnMvO9cZgaaMQyrwwXlf KFla4MrW+vNiRBJUeOm3Oa3KzHuidDJPT4I03nB55kYBzbE/Eebt/kSEj8eHbTSiNWbU 5WjQ== X-Gm-Message-State: AOJu0YxQBGyio3h+Fl2PAmatvnJe17buijumNu3lG558JrRGaae5eFJN UuZGuP6cKZx9Q3bYgVhqdhL+kfmUM63yVDFeWVgPZMosqIDW1D+lu5SQosEdZZa/VIoZ9j6vwko /LsC9Pdbn6w3iLOaw+5YetoQpVl7uVg== X-Google-Smtp-Source: AGHT+IEKKSKS8EFYcaaC4EBW+zX6/D7+CZYsilGIJhYbB6hVaPF63sRfyJDOZzQCyRIAYpCtIa6i2GJlET/S8LGU1Zk= X-Received: by 2002:a05:6358:b01a:b0:19f:801a:44fa with SMTP id e5c5f4694b2df-19fb4ff35c4mr405639055d.29.1718388609952; Fri, 14 Jun 2024 11:10:09 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <923a3373-1963-4239-b218-bcdada899024@app.fastmail.com> In-Reply-To: <923a3373-1963-4239-b218-bcdada899024@app.fastmail.com> Date: Fri, 14 Jun 2024 12:09:58 -0600 Message-ID: Subject: Re: [PHP-DEV] Revisiting case-sensitivity in PHP To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="000000000000aeb2d0061add869b" From: lnearwaju@gmail.com (Lanre) --000000000000aeb2d0061add869b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Coming from the property hooks/ asymmetric visibility dude, that's pretty rich. On Fri, Jun 14, 2024 at 10:13=E2=80=AFAM Larry Garfield wrote: > On Fri, Jun 14, 2024, at 11:22 AM, Robert Landers wrote: > > On Fri, Jun 14, 2024 at 6:40=E2=80=AFAM Rokas =C5=A0leinius > wrote: > >> > >> 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 < > ttijhof@wikimedia.org> wrote: > >> >> > >> >> Would this affect unserialize()? > >> >> > >> >> I ask because MediaWiki's main "text" database table is an > immutable/append-only store where we store the text of each page revision > since ~2004. It is stored as serialised blobs of a value class. There hav= e > been a number of different implementations over the past twenty years of > Wikipedia's existence (plain text, gzip-compressed, diff-compressed, etc.= ). > >> >> > >> >> When we adopted modern autoloading in MediaWiki, we quickly found > that blobs 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 serialized. 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 consideration as part of the impact. Potentially worthy of additiona= l > 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, > unserialization of classes with lowercase names will fail. This is becaus= e > the engine will start putting `MyClass` class entry with key `MyClass` (n= ot > `myclass`) into the loaded classes table and serialization will not be ab= le > to find it as `myclass`. > >> > Even if some deprecation layer is introduced (that puts both > `myclass` and `MyClass` keys into the table), you will first have a ton o= f > notices and then eventually end up with the same problem, when transition > to case sensitivity 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');` > should work, since MyClass !=3D myclass anymore. And serialization works > perfectly with class aliases, see https://3v4l.org/1n1as . > >> > > >> > -- > >> > Valentin Udaltsov > >> > > > > > Hey Rokas, > > > > Please bottom post (it's the rules), but PHP's "decline" has little to > > do with the language itself, most likely it has to do with how long > > people have been coding. >42% of people have been programming less > > than 9 years, and >62% for less than 14. "Hyped up" languages tend to > > dominate in the earlier years of programming and even then, most of > > the developers responding to that survey classify themselves as > > "full-stack" (and from talking to "full-stack" developers, it mostly > > tends to mean they know Javascript -- which lo-and-behold, is the top > > language; surprise surprise). > > > > I wouldn't put too much weight on that survey since it is clearly > > biased towards early-career devs, in the US, who know Javascript. > > Fortunately, the industry is much bigger than that. > > > > Robert Landers > > Software Engineer > > Utrecht NL > > While the whining about market share is off topic, the challenges of > keeping up with upgrades are valid, and have been expressed many times. > (Sometimes more politely than others.) > > I agree that this sounds like a change with very unclear BC implications > at best, and bad ones at worst, with dubious benefit. Just how much > performance would we gain from case sensitive class names? If it's 20%, > OK, sure, that may be worth whatever BC breaks that causes on the margins= . > If it's 0.2%, then frankly, no, the PR cost of pissing off people who hav= e > to manage edge cases is not worth the hassle. > > At the moment, I'm leaning No on this change, because the > cost/reward/backlash ratio is just not there to support it. > > --Larry Garfield > --000000000000aeb2d0061add869b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Coming from the property hooks/ asymmetric visibility dude= , that's pretty rich.

On Fri, Jun 14, 2024 at 10:13=E2=80=AFAM Larry Gar= field <larry@garfieldtech.com<= /a>> wrote:
O= n Fri, Jun 14, 2024, at 11:22 AM, Robert Landers wrote:
> On Fri, Jun 14, 2024 at 6:40=E2=80=AFAM Rokas =C5=A0leinius <
raveren@gmail.com> = wrote:
>>
>> I'm no one important, but I just want to say for the sake of t= he
>> 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 i= s
>> 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 k= now, but
>> if you take a look at stackoverflow developer survey over the year= s,
>> 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 fa= ns
>> 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<= br> >> 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 th= e
>> language users, there might eventually not be a language to work o= n in
>> the future.
>>
>> So please, keep the language loose, I hate the slight inconsistenc= y
>> too, but if we ruin the day for another 20% of users, it might eve= n be
>> the straw that broke the camel's back.
>>
>> On Fri, 14 Jun 2024 at 02:38, Valentin Udaltsov
>> <udaltsov.valentin@gmail.com> wrote:
>> >
>> > On Friday, 14 June, 2024=E2=80=AF=D0=B3. at 00:04, Timo Tijho= f <ttijhof@wi= kimedia.org> wrote:
>> >>
>> >> Would this affect unserialize()?
>> >>
>> >> I ask because MediaWiki's main "text" datab= ase table is an immutable/append-only store where we store the text of each= page revision since ~2004. It is stored as serialised blobs of a value cla= ss. There have been a number of different implementations over the past twe= nty years of Wikipedia's existence (plain text, gzip-compressed, diff-c= ompressed, etc.).
>> >>
>> >> When we adopted modern autoloading in MediaWiki, we quick= ly found that blobs originally serialized by PHP 4 actually encoded the cla= ss 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&quo= t;:=E2=80=A6
>> >>> # PHP 5/7/8: O:27:"ConcatenatedGzipHistoryBlob&q= uot;:=E2=80=A6
>> >>
>> >>
>> >> It is of course the application's responsibility to l= oad these classes, but, it is arguably PHP's responsiblity to be able t= o construct what it serialized. I suppose anything is possible when announc= ed as a breaking change for PHP 9.0. I wanted to share this as something to= take into consideration as part of the impact. Potentially worthy of addit= ional 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= , unserialization of classes with lowercase names will fail. This is becaus= e the engine will start putting `MyClass` class entry with key `MyClass` (n= ot `myclass`) into the loaded classes table and serialization will not be a= ble to find it as `myclass`.
>> > Even if some deprecation layer is introduced (that puts both = `myclass` and `MyClass` keys into the table), you will first have a ton of = notices and then eventually end up with the same problem, when transition t= o case sensitivity 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 you= r issue. If classes are case-sensitive, `class_alias(MyClass::class, 'm= yclass');` should work, since MyClass !=3D myclass anymore. And seriali= zation works perfectly with class aliases, see https://3v4l.org/1n1as . >> >
>> > --
>> > Valentin Udaltsov
>> >
>
> Hey Rokas,
>
> Please bottom post (it's the rules), but PHP's "decline&q= uot; has little to
> do with the language itself, most likely it has to do with how long > people have been coding. >42% of people have been programming less<= br> > than 9 years, and >62% for less than 14. "Hyped up" langu= ages tend to
> dominate in the earlier years of programming and even then, most of > the developers responding to that survey classify themselves as
> "full-stack" (and from talking to "full-stack" dev= elopers, it mostly
> tends to mean they know Javascript -- which lo-and-behold, is the top<= br> > language; surprise surprise).
>
> I wouldn't put too much weight on that survey since it is clearly<= br> > biased towards early-career devs, in the US, who know Javascript.
> Fortunately, the industry is much bigger than that.
>
> Robert Landers
> Software Engineer
> Utrecht NL

While the whining about market share is off topic, the challenges of keepin= g up with upgrades are valid, and have been expressed many times.=C2=A0 (So= metimes more politely than others.)

I agree that this sounds like a change with very unclear BC implications at= best, and bad ones at worst, with dubious benefit.=C2=A0 Just how much per= formance would we gain from case sensitive class names?=C2=A0 If it's 2= 0%, OK, sure, that may be worth whatever BC breaks that causes on the margi= ns.=C2=A0 If it's 0.2%, then frankly, no, the PR cost of pissing off pe= ople who have to manage edge cases is not worth the hassle.

At the moment, I'm leaning No on this change, because the cost/reward/b= acklash ratio is just not there to support it.

--Larry Garfield
--000000000000aeb2d0061add869b--