Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67938 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24352 invoked from network); 27 Jun 2013 11:13:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jun 2013 11:13:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=richard.bradley@softwire.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=Richard.Bradley@softwire.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain softwire.com designates 195.130.217.76 as permitted sender) X-PHP-List-Original-Sender: richard.bradley@softwire.com X-Host-Fingerprint: 195.130.217.76 eu-smtp-2.mimecast.com Linux 2.6 Received: from [195.130.217.76] ([195.130.217.76:11534] helo=eu-smtp-1.mimecast.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/23-08517-86E1CC15 for ; Thu, 27 Jun 2013 07:13:46 -0400 Received: from smtp.softwire.com (31.221.86.178 [31.221.86.178]) (Using TLS) by uk-mta-8.uk.mimecast.lan; Thu, 27 Jun 2013 12:13:41 +0100 Received: from VEXCHANGE10.zoo.lan ([169.254.1.83]) by VEXCHANGE10.zoo.lan ([169.254.1.83]) with mapi id 14.02.0342.003; Thu, 27 Jun 2013 12:13:40 +0100 To: Tjerk Anne Meesters CC: Florin Patan , Jeremy Curcio , PHP Internals , Sebastian Krebs Thread-Topic: [PHP-DEV] Gauging Interest:RFC to add map() function Thread-Index: AQHOcoe57NjS4Y8ENEOzQZr9aS67v5lJJ5KAgAAC5ICAAA37AIAAB1GAgAALXgCAAB4tEA== Date: Thu, 27 Jun 2013 11:13:38 +0000 Message-ID: References: <4622f2d7-8c09-4a31-943e-7732a9481a9a@me.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.210.11.76] x-pp-processed: __PP2__318564c6-eb00-4118-ba4c-be920aac5003 MIME-Version: 1.0 X-MC-Unique: f422cb6f-68e1-4961-a64a-59586cb3fe9b-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Subject: RE: [PHP-DEV] Gauging Interest:RFC to add map() function From: Richard.Bradley@softwire.com (Richard Bradley) > -----Original Message----- > From: tjerk.meesters@gmail.com [mailto:tjerk.meesters@gmail.com] On Behal= f Of Tjerk Anne Meesters > Sent: 27 June 2013 11:24 > To: Sebastian Krebs > Cc: Florin Patan; Jeremy Curcio; PHP Internals > Subject: Re: [PHP-DEV] Gauging Interest:RFC to add map() function > > On Thu, Jun 27, 2013 at 5:43 PM, Sebastian Krebs wro= te: > > > > > > > > > 2013/6/27 Tjerk Anne Meesters > > > >> On Thu, Jun 27, 2013 at 4:27 PM, Florin Patan > >> wrote: > >> > >> > On Thu, Jun 27, 2013 at 10:17 AM, Tjerk Anne Meesters > >> > > >> > May I kindly ask why all the PHP users would want this function in > >> > the core? > >> > > >> > >> Are you meaning to ask why would *any* php user want this function in > >> the core? As with most things, the need of one may be shared among a > >> critical mass that could swing the balance. In practice though, the > >> critical mass is usually determined by the internals peeps :) > >> > > > > But this method is _really_ quite special, isn't it? I cannot imagine, > > that there is "critical mass", that needs this _in core_. > > > > I'm not casting any judgement on its usefulness; I'm merely arguing the > "why should this be in core? I would never use it." narrative is not cons= tructive. It can serve as an indication of which way the he would vote if this came t= o RFC. It can give a single data point towards how many people would find this use= ful. You did ask what people thought of the proposed method. I don't think you s= hould simply reject negative answers as "not constructive". > >> > And as I understand, PHP delegates the math stuff to the underlying > >> > C implementation so why would it be faster having it in PHP core > >> > rather that in PHP userland? > >> > > >> > >> Performance is not the only reason why features make it into the > >> core; it's providing a rich set of built-in features to make the > >> developer's lives easier, such as the latest password hashing API > >> which is easy to get wrong or generators that reduce boiler plate > >> code. > > > > You cannot compare language features (generators) with functions. And > > "security" is always a topic on its own. > > > > I consider new functions as a feature of the language as well, so there's= no need to make comparisons. > > That said, would you have guessed (without looking at the manual) that PH= P exposes a > "hypot($x, $y)" where you could otherwise have written "sqrt($x * $x, $y = * $y)"? > > Okay, it's a translation from of course, but it came as a surpri= se to me :) There is a good reason to have "hypot" in the C layer -- it is not possible= to implement it in PHP correctly (and efficiently), due to overflow concer= ns. See http://en.wikipedia.org/wiki/Hypot for a summary. The same concerns do not apply to this affine transform, which is why it sh= ould not be in core. If there were sufficient demand for it, then it might justify a PECL extens= ion. My impression is that there is not. Best, Rich Richard Bradley Tel : 020 7485 7500 ext 3230 | Fax : 020 7485 7575 softwire Sunday Times Best Small Companies - UK top 20 three years running Web : www.softwire.com | Addr : 325 Highgate Studios, 53-79 Highgate Road, = London NW5 1TL Softwire Technology Limited. Registered in England no. 3824658. Registered = Office : 13 Station Road, London N3 2SB