Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123603 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 C5C7B1A009C for ; Fri, 14 Jun 2024 14:56:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718377068; bh=kggtZAnYWlhSazHz1sQ64/BZ3eYTt00bXlIEcsHd/R4=; h=In-Reply-To:References:Date:From:To:Subject:From; b=aDIkEwb6NQe030oc83QfKrxVbm6DHlD9fVkR45AWDui79e/uWE6qqZluo6tlkpiLv sK01GCkbzcmzGiWBuHzCFrd8qP4OMyBZGwG6XfvM0gPKdIRK9Sh5Q5HrUlJ7U51XBb gNEEtFUlQSI3dyKVvKEVbDzvc3aVvNmLlfJnBh19u4sq1X00qchhl2OzbmhGBLV5ka WhrROb3t3z02cdAfPDHQU6V8TS8uqImK2oxirQ+tVPFX1IZrg2JrvoXIq9IUpYFnxu wf8WzNbNSE0lQsWYJ0CeUHlTzCfKayqoNzHxpypRHIfQMZZYndDoMuuWylzCCz7RZo ZPQhX2NpfCUkA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7B15318007A for ; Fri, 14 Jun 2024 14:57:47 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE,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 fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) (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 14:57:46 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 74B6611401F2 for ; Fri, 14 Jun 2024 10:56:36 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Fri, 14 Jun 2024 10:56:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm1; t=1718376996; x=1718463396; bh=GJQcUf/La1EHOFcES9DWm tZ4B/0FfaHAvIdEQEta+cE=; b=sFVV1rp+26cIG+hc0ulsL1agoFKZ9wsB2/KxW wHuu5/DSKijXwQM2M6iIm2iwSkzbb2dSGzEAE1xDJSUr1+x6pMQUzmv0lcSemEQg siPZS4x7VZ+B8hc7bHaTky0Tdwonq20pDOu1vc7+oyM7pJUC/MEAu82mEvF2U9/6 EPTXK3Io15gvFCcSaMJvJEcVknv43GtjaeNAMvY3+wAU/PMnCuJB1m8ii4avRfal 4wMQ1e0Keoy1u/Xwmr1+puQ8iiPmKsCPl1yNjMc08Mkk0OqvqXEq7+GCA0aWkdDQ vu+oZN/He0Z3CjGFXGM0uQI04bmQOOZCJFzWJyHx3rfNltiEg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1718376996; x= 1718463396; bh=GJQcUf/La1EHOFcES9DWmtZ4B/0FfaHAvIdEQEta+cE=; b=L 1SKKRJ1QdHe+rdcaoXHK/lAPMoB+TRVPTqUHPFzEGqnlvgOcXkt2la/TB5FXQ638 ttZNXJvmz58USTUI6bQgMFgI1IsytHfkREz2azyMDOtHceYw/F1f/B1ozfdKhOB5 gcrXlSlOsaMhSVQOP6tuFxXngOlXHCq5C62eg38XZmhhdUf45urn5ohIGazkJxmz 4nQLYW8OtMyU0wkklDtXe8HhGrVw/wAUgofjMGjhsp1+xqq7U+RctF+6gBoUwJpL WPDBjV/xw25yInz/4dwS0tXxJt6mc4paKqxr+fIQ0r8xcRkxFsZut1QaTiYLiFbk dG88aNjawNDA2ErC79UoA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeduledgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne goufhushhpvggtthffohhmrghinhculdegledmnecujfgurhepofgfggfkjghffffhvffu tgfgsehtqhertderreejnecuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoe hlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnhep ledtudduudeitdegueektdekvdehleevudehteevvedvueehheffjedtkedthffgnecuff homhgrihhnpeefvheglhdrohhrghdpthhimhhothhijhhhohhfrdhnvghtnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrh hfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id EC4D71700093; Fri, 14 Jun 2024 10:56:35 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-515-g87b2bad5a-fm-20240604.001-g87b2bad5 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: <923a3373-1963-4239-b218-bcdada899024@app.fastmail.com> In-Reply-To: References: Date: Fri, 14 Jun 2024 14:56:14 +0000 To: "php internals" Subject: Re: [PHP-DEV] Revisiting case-sensitivity in PHP Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") 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 wrote: >> >> >> >> Would this affect unserialize()? >> >> >> >> I ask because MediaWiki's main "text" database table is an immutab= le/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 have be= en a number of different implementations over the past twenty years of W= ikipedia'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 cla= sses, but, it is arguably PHP's responsiblity to be able to construct wh= at it serialized. I suppose anything is possible when announced as a bre= aking change for PHP 9.0. I wanted to share this as something to take in= to consideration 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, unserial= ization of classes with lowercase names will fail. This is because the e= ngine will start putting `MyClass` class entry with key `MyClass` (not `= 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 `mycla= ss` and `MyClass` keys into the table), you will first have a ton of not= ices 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 your issu= e. If classes are case-sensitive, `class_alias(MyClass::class, 'myclass'= );` should work, since MyClass !=3D myclass anymore. And serialization w= orks 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 kee= ping up with upgrades are valid, and have been expressed many times. (S= ometimes 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 pe= rformance would we gain from case sensitive class names? If it's 20%, O= K, 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= have to manage edge cases is not worth the hassle. At the moment, I'm leaning No on this change, because the cost/reward/ba= cklash ratio is just not there to support it. --Larry Garfield