Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38289 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2160 invoked from network); 16 Jun 2008 17:16:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jun 2008 17:16:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=davelee.com@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=davelee.com@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.200.172 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: davelee.com@gmail.com X-Host-Fingerprint: 209.85.200.172 wf-out-1314.google.com Received: from [209.85.200.172] ([209.85.200.172:51353] helo=wf-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/71-06776-7EF96584 for ; Mon, 16 Jun 2008 13:16:24 -0400 Received: by wf-out-1314.google.com with SMTP id 26so5166448wfd.26 for ; Mon, 16 Jun 2008 10:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=F8z21tE2N4bfzU5pRIIdaakRYkrtaS09oKOXquMfnHY=; b=RRCLJ2+rToKVKLVksB/B9fIyolxLDhDfp03JaF1xVAeREfjxxHvxX6gMX1C+zVAEuX zuny5yGie7fiZ55aO1glstgWGD3+BCJwReeFguR703prHrHxQ7ueLquvrOYBb5soTiax lcIXlpX+B5HtjCpa0YhkOCiKdl4fx9dM+vZtA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=Rl5K6vBg3ZIrEYIZbE77piiIDTejJyfS7RJZjUfksPMPX687G/mDHCgmjkUNaT0IYr ZgJejQqfFPDqajchDd2CQjXWxBpcJKWcrYTDFCuXjicSLPFMJWZNTPbSOrAM9JXXF1E2 XcREchhpaBsFiiLBosXJt/cBKKgpA8/c6ds3w= Received: by 10.142.156.2 with SMTP id d2mr2445783wfe.321.1213636581330; Mon, 16 Jun 2008 10:16:21 -0700 (PDT) Received: by 10.142.193.17 with HTTP; Mon, 16 Jun 2008 10:16:21 -0700 (PDT) Message-ID: Date: Mon, 16 Jun 2008 11:16:21 -0600 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7706_27339844.1213636581322" Subject: case folding array string keys From: davelee.com@gmail.com ("Dave Lee") ------=_Part_7706_27339844.1213636581322 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I have a patch that I'm hoping might be useful to PHP developers, at least those using PostgreSQL. The patch provides case folding of string keys during hash lookups. The need for this comes from ... We're transitioning from MySQL to PostgreSQL, and like many, we use camel casing for naming tables and columns in our db. In PostgreSQL, (unquoted) table and column names are case folded to lower case, so where we currently have $row['someForeignId'], we would need to rewrite the key to 'someforeignid'. Besides being a lesson that we should use _ naming in the future, it was clear there was no quick solution, we'd be forced to modify many lines of code, and possibly end up with less readability. Instead, I added a caseFold flag to the HashTable struct, which is later checked in zend_hash_find() where, if configured, case folding of the key is performed before hash lookup. My question to the list is, can this functionality be added in a way that doesn't adversely effect developers who won't use it, but helps us PostgreSQL users and anyone else who might find it useful? Judging from my searches on the subject, it's not an uncommon impedance for PHP/PostgreSQL users. thanks, Dave ------=_Part_7706_27339844.1213636581322--