Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85682 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13198 invoked from network); 2 Apr 2015 00:36:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2015 00:36:46 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.46 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.46 mail-pa0-f46.google.com Received: from [209.85.220.46] ([209.85.220.46:34830] helo=mail-pa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7C/60-07407-D1F8C155 for ; Wed, 01 Apr 2015 19:36:45 -0500 Received: by patj18 with SMTP id j18so67469936pat.2 for ; Wed, 01 Apr 2015 17:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=XvXRy2cgl0dU/oB6tpebkqPkc4LKhxOqlbCQA4YufNY=; b=z2GKyfZGUJVmxUJvJInuoXuHlrFMyMesO2Lm5JsNvzLsxdj/jXNBIO5fYwSSBKR0Pt 7cUczljklaL+la6Ca4DuiN9om4usoBuAbfeo2eRwrwN+8c4g1ILpDws2sk5rgtk3L6rP aX/hSy6CgGA3Hu9MPtLr3PJeg0U42btBCWYPJqn+ZCJ4hApWCCCOeY2xOo2/M3FGThY7 i+11nIOqoqiFiAAVm8+Q/FXQ/YUwsiw3aD1fpn2Cp7tVdn3NKcbzg6Jsr2TeIzj2DyfT +LG5IFNoB5I/6+sC8AqPVD2Mv/3ekdXd25ut2iMzTk+uhJBILT0BxDA9l58otIpzin1W O4xw== X-Received: by 10.70.93.36 with SMTP id cr4mr13095846pdb.68.1427935002072; Wed, 01 Apr 2015 17:36:42 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id w17sm3093698pdj.6.2015.04.01.17.36.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 17:36:41 -0700 (PDT) Message-ID: <551C8F18.7080401@gmail.com> Date: Wed, 01 Apr 2015 17:36:40 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Christoph Becker , Dennis Birkholz , internals@lists.php.net References: <551BC7CF.3080309@birkholz.biz> <551C44C7.6060108@gmail.com> <551C48AC.3090908@birkholz.biz> <551C4A60.2050805@gmail.com> <551C5045.3010405@birkholz.biz> <551C56E2.8090100@gmail.com> <551C5AFB.7090107@birkholz.biz> <551C6296.40101@gmail.com> <551C7B32.70200@gmx.de> <551C7D86.6040608@gmail.com> <551C8B8C.4050206@gmx.de> In-Reply-To: <551C8B8C.4050206@gmx.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] What's our official stance on small self-containedadditionsin a micro version From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > But what is "properly prefixed"? Is there a list of reserved prefixes? Yes, it's called the manual :) > I agree. However, there are other "namespaces" which are not so > special, especially for beginners, for instance, array_* and str_*. And Adding something like strlen() in core now probably would be dangerous. array_* OTOH should be obvious as reserved. Just follow common sense - if you prefix your function the same way as a function group in the manual, then you're in trouble. > of course, someone might consider it to be reasonable to invent a new > function in userland which is an extension of some existing function, > therefore giving it a similar name, e.g. preg_replace_callback_array(). Someone would be wrong then. > Would that be considered to be bad style? If so, where is it documented? Yes. It is common sense. Not everything has to be spelled out to be true, and I think rule lawyering and ignoring common sense is not going to help anybody here. If you don't understand that adding preg_* function in global namespace that looks like existing core function is a bad idea, maybe some mentorship by more experienced developer is in order. > I'm aware that I'm nit-picking, and that the probability of such > collisions is near zero, but it is not equal to zero. If we limit ourselves only to changes that have exactly zero chance of affecting somebody's work however weird and broken that is, we may as well pack our things and go home, because we'd never do anything at all. I'm feeling that I am arguing with more and more bizzare scenarios invented for the purpose to arrive at predetermined conclusion instead of determining conclusion by real scenarios that sane developers do. -- Stas Malyshev smalyshev@gmail.com