Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23140 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2636 invoked by uid 1010); 4 May 2006 00:58:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2621 invoked from network); 4 May 2006 00:58:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 May 2006 00:58:29 -0000 X-PHP-List-Original-Sender: dante@vocalspace.com X-Host-Fingerprint: 69.56.193.72 fox02.stravio.com Linux 2.5 (sometimes 2.4) (4) Received: from ([69.56.193.72:49481] helo=fox02.stravio.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 39/6C-63443-4B159544 for ; Wed, 03 May 2006 20:58:28 -0400 Received: from [127.0.0.1] (unknown [66.243.31.162]) by fox02.stravio.com (Postfix) with ESMTP id 9442E26C2F0; Wed, 3 May 2006 19:26:19 -0500 (CDT) Message-ID: <44594A27.4040201@vocalspace.com> Date: Wed, 03 May 2006 19:26:15 -0500 User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 To: Jochem Maas Cc: Rick Widmer , PHPdev References: <44584619.60400@lorenso.com> <200605030815.34801.johannes@php.net> <44585828.1030603@vocalspace.com> <44585E89.6000400@vocalspace.com> <44586BDF.6040600@developersdesk.com> <4459410D.9090802@vocalspace.com> <445942E9.201@developersdesk.com> <44594553.6020009@iamjochem.com> In-Reply-To: <44594553.6020009@iamjochem.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Seeking 'coalesce' php internal function From: dante@vocalspace.com ("D. Dante Lorenso") Jochem Maas wrote: > point 1: regardless of how people think there should be an ifsetor() > in the engine - the devs don't so there wont be one. Arrrrvvhggghh! Don't you just want to scream! > point 2: anything trying to implement this functionality in userspace > is a hack. (to stregethen that stance: Rasmus reiterated the point a few > days ago [can't remember which mailinglist] that people should be > trying to > write *error free* code - ergo the error suppression is not a proper > solution) Ok. You CAN NOT implement 'ifsetor/coalesce/filled' in userspace. And the devs don't want it to exist ... so, WTF? > Dante, live with the hack. :-) Translate to: Dante, you don't need PHP to be better, adequate is good enough. Come on devs, I'm pleading with you. Say it isn't so. You force me to write so much extra code unless this functionality exists in the core. Explain to me how every possible thing you might want to do to an array gets it's own function in the language, but something as trivial as this gets refused so strongly! I mean really: array_change_key_case, array_chunk, array_combine, array_count_values, array_diff_assoc, array_diff_key, array_diff_uassoc, ... http://www.php.net/manual/en/ref.array.php You can't tell me that most if not all of these functions could not have been implemented in userspace? I might use 10% of all the array functions, but I'd use 'coalesce' and 'filled' daily. Tell me at least this much. Can these two functions be implemented as an extension? From what you know about PHP internals, does what WE want have to be a language construct? If I can write coalesce() and filled() as extensions, I'll submit a new extension/patch. Maybe it could join PECL and with popularity make it's way begrudgingly into the core? Dante