Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83641 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28232 invoked from network); 24 Feb 2015 08:02:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2015 08:02:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=pajousek@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pajousek@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.43 as permitted sender) X-PHP-List-Original-Sender: pajousek@gmail.com X-Host-Fingerprint: 209.85.192.43 mail-qg0-f43.google.com Received: from [209.85.192.43] ([209.85.192.43:52161] helo=mail-qg0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/D3-09240-0103CE45 for ; Tue, 24 Feb 2015 03:02:25 -0500 Received: by mail-qg0-f43.google.com with SMTP id i50so28715334qgf.2 for ; Tue, 24 Feb 2015 00:02:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=fQVpXG6p+G7Qci+UUdOcVMaY52dw3UW63bQ6iUGN0kE=; b=dzdZnSVPyWKCRZa6ufYm28jmFV/N+EjSVs6rw8sfuEm+Yg3kHpRdRmLXP0SJUfYdWL uaSKRSNSAKd10jgJSUm/i4vC5kz1jKzGgRPR9D2rHf0FfO+UG29sAC9C5DVhp/JJfTYu OlrZPSIi0XMtzDAe06KuV3uoFiHiaSkJqhlTshYVhA6X/P51Wc+lNQwcxVFPbrBzD+go oGT8uZghMu5f5O/gJ1j6i3V4CpKzORnqCALnQuCz168rN8NnJjzqle+6qelnSq3J/mz3 lsDTBtsdeyyDj+ZkLVqG1LkCZ9h7gBRTJq/tLfFWReG5HBZAdn9KczIKOFf3zCqxf6Ki PQew== MIME-Version: 1.0 X-Received: by 10.229.241.137 with SMTP id le9mr34197972qcb.20.1424764941662; Tue, 24 Feb 2015 00:02:21 -0800 (PST) Received: by 10.96.160.99 with HTTP; Tue, 24 Feb 2015 00:02:21 -0800 (PST) In-Reply-To: References: Date: Tue, 24 Feb 2015 09:02:21 +0100 Message-ID: To: Alexander Lisachenko Cc: PHP internals list Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [Discussion] Last chance for case-sensitive engine From: pajousek@gmail.com (=?UTF-8?Q?Pavel_Kou=C5=99il?=) On Tue, Feb 24, 2015 at 8:48 AM, Alexander Lisachenko wrote: > Morning! > > I want to ask this question one more time before PHP7 feature freeze: can > we the engine case sensitive from PHP>=7.0? > > There is a draft for that: https://wiki.php.net/rfc/case-sensitivity > (mostly empty), so I decided to ask this question in the internals mail > list. > > Pros: more simple O(1) hash table checks for properties, functions, > methods, classes without strtolower normalization on the engine/parser > level. Consistency with unicode class names (yes, they are case sensitive, > check http://3v4l.org/ia0pc), consistency with exisiting PSR0,4 standards > (case sensitive mapping of class names to the file names) > > From my experience, all modern PHP framework don't use case-insensitive > code, so chance to break anything for them is really low. > > Cons: on the extension level things aren't so good and can be some BC > breaks (like with phpng) > > Possible ways: > > 1) Keep PHP engine case-insensitive for PHP7 > 2) Make PHP engine case-sensitive since PHP7 with possible minor BC breaks > in the extensions (this breaks can be easily fixed) > 3) Add a compile-time switch, eg. --with-case-sensitivity to the > configuration to have an ability to build PHP with sensitivity and make > this option enabled by default since next major version (PHP>=8.0). Add > deprecation notices in 7.x > > Thoughts? Hello, I'd personally LOVE PHP being case-sensitive, but I think it's not possible. Sure, frameworks and newer code will won't be broken, but what about the tons of "legacy" code? Personally, I saw too much code (and even examples in tutorials!) using stuff like MySQL_Query(). And case sensitivity would break this code without a doubt. (I know mysql ext is deprecated, but that's relevant right now, this is just one of many examples - the most common one I can think of, actually). On the other hand, this could be fixed by running some migration scripts over code base, so maybe it's not THAT bad? Who knows. Regards Pavel Kouril