Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123595 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 527381A009C for ; Thu, 13 Jun 2024 19:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718308207; bh=Zi3u8OAe/xYTEzplc4lMcoD7V6Wa25cC0lMdDZgpzWo=; h=References:In-Reply-To:From:Date:Subject:To:From; b=QGTJGEsyo3gjHfzw59D5T4KZ/UEHUSA1tlO/uxwZDA7vzr/EUxcUMl/BB1ik2jX3t 2xAFmSYuakrKwgHtZaLvJgG8E2adOUdB9M/wu0YEpQteE8C4kt4QNMF4RBjdRHaymJ E4LSVYpRZyIwkKeRJ+DjMOcw6laA/nuMItnGxai+WHRpQePFGzrGpdBhaHZ2KiqWJ4 tYPo1eTDwEenE/vPl+bw2X+UM1xm47aawUlS9283iB6//RKn/kwqnt1wyhas+gGf6d FAgQetNwtV8uuh0ha7mySUsB2E3YqpDcrPv8ziReYxaal3HAFIazXAIEEgyUX51yWJ YN/kJhzGnUNBg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3079A180039 for ; Thu, 13 Jun 2024 19:50:06 +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.3 required=5.0 tests=BAYES_50,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (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 ; Thu, 13 Jun 2024 19:50:05 +0000 (UTC) Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-6fa0edb64bdso711784a34.1 for ; Thu, 13 Jun 2024 12:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wikimedia.org; s=google; t=1718308135; x=1718912935; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=Zi3u8OAe/xYTEzplc4lMcoD7V6Wa25cC0lMdDZgpzWo=; b=eJaO+72gVpLEOe3eVLnNziQNEoSdRxgq8krp50coA4FzHSyNyIdv8e8ydcrwRsBxIs ZM6HamDgQhncjtlBQiyiUKwuGECwbRG55AFbGeLAePq80QTL0bBPVRnEsrsQSgYcIPOa MFnTcwS7AueRIE3JrtJEDIhnfCkFYWx1NGn0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718308135; x=1718912935; h=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=Zi3u8OAe/xYTEzplc4lMcoD7V6Wa25cC0lMdDZgpzWo=; b=GnNlWND5XH6AjBmaOvrr1FdUU4cd95zaaK/C+9pyAgzgilcjO9tjY4j8wIDMhvCOrS ecgJgcnWyTxK9xDADg1vXEfeGfAs71eYvLIpBEs25RNHZKeMXgotQFDwWhtPhk4OfEvU iRNhCD1K/WhUM9EgNdaprWdy/aKm0yguA8RWuSdMIQ5jOe7kk4/8K/54TDWFPpg9/h6s VcfwqUsjFC5/8DHiTwiMS3KwR7KQH3Bvs+Fp5nkUXYf4ndi0fx/iyis1/h6uCIH+rxqJ l7E58e+ufzny2E06EYorX6kK0URDKXdi5wMpf7nSjPXXFzeT+nfQ/PR5vn7tnT1A/G3G 49nA== X-Gm-Message-State: AOJu0YyEsn8kLDYvnvhNW6hAX3HeRY2TKW5e15TpRPsN8ks1MopP8xdQ 7dZ+3ekDxaFf7HY0qNv2r6bPfCGmfTlsxtWmm6JjneEQ6OdaakHX29jWa3hj7ex/rhSj4iTF0Zz fRLQ45bpoO4O4saG4gLlcenyIqOfklQxuxSg43JS2b4mF3n9YyQs= X-Google-Smtp-Source: AGHT+IED04+C6hvO7O//9yf7PpoYWFKDKRnDWNbcM8lF1lOG+7Yp2YySJwDMVnq0GN/9oFs9Gc/nA/sv41On1oKQmfA= X-Received: by 2002:a05:6870:1594:b0:254:746f:1fe1 with SMTP id 586e51a60fabf-25842b7f26amr661998fac.57.1718308135101; Thu, 13 Jun 2024 12:48:55 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 13 Jun 2024 20:48:19 +0100 Message-ID: Subject: Re: [PHP-DEV] Revisiting case-sensitivity in PHP To: php internals Content-Type: multipart/alternative; boundary="000000000000020e12061acaca3d" From: ttijhof@wikimedia.org (Timo Tijhof) --000000000000020e12061acaca3d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 have 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 additional communicating, or perhaps worth supporting separately. -- Timo Tijhof, Principal Engineer, Wikimedia Foundation. https://timotijhof.net/ --000000000000020e12061acaca3d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 rev= ision since ~2004. It 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 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 actu= ally encoded the class in lowercase, regardless of the casing in source cod= e.

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<= /blockquote>

It is of course the application's = responsibility to load these classes, but, it is arguably PHP's respons= iblity to be able to construct what it serialized. I suppose anything is po= ssible when announced as a breaking change for PHP 9.0. I wanted to share t= his as something to take into consideration as part of the impact. Potentia= lly worthy of additional communicating, or perhaps worth supporting separat= ely.

--
Timo Tijhof,
Principal Engineer,
Wikimedia Foundation.
https://timotijhof.net/
--000000000000020e12061acaca3d--