Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123600 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 7AEA51A009C for ; Fri, 14 Jun 2024 11:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718364249; bh=yuzRNt8JeMl9MGc8tlKcw0gS0c9/URuEAauNL7nw2Mg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=UhusnH0+94znKC95RXVr7DTeIjY2XFPRpnBsox6rvx1jis2uPhtgxMyiqTYPSE/at +PQ0F0hrNDdv3EGdGgJkiNCBXWgj1IQltc7yKgm6Tq3bn+TnGcx4CVe54B89K1t7vy CamP0JLimqLckbRxFXhL93dg550zRY4blmAqh0mfTuNX2GgxMQEZE5FeHvZslLX7e2 8c0Kel2VQkXePT+61pqpSQcnj+ddyKwg93E4+Q5ofQGnnR8f0GdUm4xOsEb6QXgByP UN/vsWkeKj+xzZ0haQv+WxIlGGzl+ELVoC131i4r6GJ3kCbyoustm0t6mR1St9ryEe 04jUl18OLfvEQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 17E7918004B for ; Fri, 14 Jun 2024 11:24:07 +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, 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-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 11:24:06 +0000 (UTC) Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2eabd22d3f4so22154111fa.1 for ; Fri, 14 Jun 2024 04:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718364175; x=1718968975; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=yuzRNt8JeMl9MGc8tlKcw0gS0c9/URuEAauNL7nw2Mg=; b=LNJLMk0e+9cvgsIo9o7YZQVGn+vhQ5O/rAO7I8jV3EW3bhNQgbr/dzO/t4jMDckQ3H lfSi01N/sLmTaZJpuPTKBI0mH9IqILNAMqJaaImrq/G/ZJFPZGnXgv8FNZLMe2sFEND4 PU/ms2hVIRQvxUsoN1eRkHhOt27tTxHlxrb05bs+GcafgxqaYCyhsVueoBqCY2SM9fnX LxbVgJ7xO3dxzbITcNqaiL8X5O9wSgrG62S/EWOd23fzrHn6A3fEKtl4RATUoES0G1/3 MfrQh4o44aKK8UpV/SYx7tM+EXvYVrjx9rv2QwH82J0KbN5S7vbnxyCCIYJNQbUjydYp 1LwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718364175; x=1718968975; h=content-transfer-encoding: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=yuzRNt8JeMl9MGc8tlKcw0gS0c9/URuEAauNL7nw2Mg=; b=c74kR7KBz3e0NwYc6jJhoFClyz7yKTdovIgOwyNKSeaCivbNXQXg4zjDB/rkbzrUZS Ro3SkQduZ8MijLlik9r/R0/GPBKvVjRA1zLFHWzzjbN6z43xVbqMYbQJ6C542jrETFNn dOdtMyYGKKgj1XirBI72j93M80LwveLLpK0eeQZ5vznf2NfygzZF//1BIVuOZc1R8f2i U9iwkPWmQLwbVXifeDjWv4c0i7B3xjFRROLvm6AjgbHN+ipvMT2djcouGWmVL60nGY5x mAnkxglpTov+2NvIo0+Vzb55to+2RkP1MA4NcfZIPYgZ1eOy9JHLDNPk3mfOdSR7PCt4 +aWQ== X-Gm-Message-State: AOJu0YxHBTVZI6WPaPoEBNeMQgBC6CWp8m1u5ckx0T6potZKRkPfK0B9 5aQKIxJLjgOREHxtAVb9bBky9X1QlIDqsxRJ7RKxbFQer2fEkZqC33GXc9dLiQ5+iYCu7AOa4Zt 1zhguelffzuJgNsVOAAo2rgs3Auo= X-Google-Smtp-Source: AGHT+IHEVdFt1t6Sp/TjtB2BdR0d5MZCmqA34Xzfgr0A7gRpoqpu+XdPCZS0SDgVOq3SxAO4BvWupQYucxW0eAhZnvQ= X-Received: by 2002:a2e:b04a:0:b0:2eb:e505:ebea with SMTP id 38308e7fff4ca-2ec0e5d0b93mr15937841fa.25.1718364174796; Fri, 14 Jun 2024 04:22:54 -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 13:22:42 +0200 Message-ID: Subject: Re: [PHP-DEV] Revisiting case-sensitivity in PHP To: =?UTF-8?Q?Rokas_=C5=A0leinius?= Cc: php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: landers.robert@gmail.com (Robert Landers) 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 immutable/a= ppend-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 been a numbe= r of different implementations over the past twenty years of Wikipedia's ex= istence (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 lowerca= se, 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 s= erialized. I suppose anything is possible when announced as a breaking chan= ge for PHP 9.0. I wanted to share this as something to take into considerat= ion 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, unserializat= ion of classes with lowercase names will fail. This is because the engine w= ill start putting `MyClass` class entry with key `MyClass` (not `myclass`) = into the loaded classes table and serialization will not be able 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 an= d then eventually end up with the same problem, when transition to case sen= sitivity is complete. Hence I propose no deprecation layer =E2=80=94 it doe= s not really help. > > > > However, you will be able to use `class_alias()` to solve your issue. I= f classes are case-sensitive, `class_alias(MyClass::class, 'myclass');` sho= uld work, since MyClass !=3D myclass anymore. And serialization works perfe= ctly 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