Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70691 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53876 invoked from network); 17 Dec 2013 01:24:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Dec 2013 01:24:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.213.41 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.213.41 mail-yh0-f41.google.com Received: from [209.85.213.41] ([209.85.213.41:47629] helo=mail-yh0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 87/F5-32483-BB7AFA25 for ; Mon, 16 Dec 2013 20:24:12 -0500 Received: by mail-yh0-f41.google.com with SMTP id f11so4528858yha.0 for ; Mon, 16 Dec 2013 17:24:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=aiOzI1MEE8VoYaw05fMkhWp0roxMLB72U5GoZ2OZ0f8=; b=cb9v7BqrlEiPqUUZY/qJqktrTVoj5/uMe0JnOtgU727reIsanjOlvYQITI1HDA89DE p8od+x90aakWmXjHJpuy4OEds55oHiSvTEBVybKpjgvvRWWq+9Otr1cVdKgTXs9bzd/Z Uqb91Zv4B+VBnQ+3/bcrMnWWqaGUZO5BwdCKMOCSd8seqZiGktXI82Auth7alfrc5LFi 2wszAFYcp+f0hqDvk6wyFDRFzlrmUgWLpCBV0mA1uVv6M8jQIfyVvhQH+gXiJoUPR4Vq y8iBGLz1scjTlkAQ+tyw3z76Z5lqP4molcNUDRoKZxEHyriAwebuoLsgT6eAS5ZexUra Y0Sg== X-Gm-Message-State: ALoCoQkJm/Q1jAdWHO3PLCyfoMUSDflYcHPDUT+br+2IytpEswDGPB369z/lpO9sEK+gCZYNk2Ci X-Received: by 10.236.223.168 with SMTP id v38mr9211025yhp.86.1387243448882; Mon, 16 Dec 2013 17:24:08 -0800 (PST) Received: from [192.168.1.100] (cpe-74-71-241-32.nyc.res.rr.com. [74.71.241.32]) by mx.google.com with ESMTPSA id j67sm21943234yhe.26.2013.12.16.17.24.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 17:24:06 -0800 (PST) Message-ID: <52AFA7B6.1030305@lerdorf.com> Date: Mon, 16 Dec 2013 20:24:06 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Rowan Collins , internals@lists.php.net References: <52ABFE84.8010404@cerny-online.com> <52AF4383.3070406@gmail.com> <52AF4DD3.1090609@cerny-online.com> <52AF5C5F.5020101@gmail.com> <52AF7044.5080001@cerny-online.com> <52AF9B10.9020301@gmail.com> In-Reply-To: <52AF9B10.9020301@gmail.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Flexible function naming From: rasmus@lerdorf.com (Rasmus Lerdorf) On 12/16/2013 07:30 PM, Rowan Collins wrote: > The core functions which follow neither rule include C-style > abbreviations like "strptime" which couldn't be automatically swapped to > either format, and complete anomalies like "nl2br". If you named those > functions as part of a consistent style, you would probably also follow > stronger naming conventions than Rasmus did when he named > "htmlspecialchars". Well, there were other factors in play there. htmlspecialchars was a very early function. Back when PHP had less than 100 functions and the function hashing mechanism was strlen(). In order to get a nice hash distribution of function names across the various function name lengths names were picked specifically to make them fit into a specific length bucket. This was circa late 1994 when PHP was a tool just for my own personal use and I wasn't too worried about not being able to remember the few function names. -Rasmus