Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79105 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64193 invoked from network); 23 Nov 2014 18:39:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2014 18:39:26 -0000 Authentication-Results: pb1.pair.com header.from=bill@devtemple.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=bill@devtemple.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain devtemple.com from 50.116.27.81 cause and error) X-PHP-List-Original-Sender: bill@devtemple.com X-Host-Fingerprint: 50.116.27.81 li478-81.members.linode.com Received: from [50.116.27.81] ([50.116.27.81:51652] helo=mail.devtemple.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/40-55989-CD922745 for ; Sun, 23 Nov 2014 13:39:24 -0500 Received: from BillHP (pool-71-110-124-28.lsanca.fios.verizon.net [71.110.124.28]) by mail.devtemple.com (Postfix) with ESMTPSA id 96B5E498F for ; Sun, 23 Nov 2014 13:39:18 -0500 (EST) To: Date: Sun, 23 Nov 2014 10:39:18 -0800 Message-ID: <012701d0074c$ccfe6f40$66fb4dc0$@devtemple.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0128_01D00709.BEDC19A0" X-Mailer: Microsoft Outlook 14.0 Content-Language: en-us Thread-Index: AdAHR+2wpA17pH7uRJ+8sCnt0clojQ== Subject: enhance fget to accept a callback From: bill@devtemple.com ("Bill Salak") ------=_NextPart_000_0128_01D00709.BEDC19A0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi list, I'm considering writing an RFC to add a 3rd parameter to fgets which accepts a user defined function. If we had this today we wouldn't need fgetcsv with the added benefit of fgetcsv style support for data packaging formats we would otherwise create more 1 off functions for. For example, if we decided to support reading json from files in the same manner as our current fgetcsv functionality today, we would create an fgetjson function. This change unifies the way in which we support native transliteration of data packaging formats from files into php data structures through a single interface. The other major design benefit, from my point of view, is the unification of userland transliteration functions/libraries with the same modality as our native support for these types of use cases. I believe this will ultimately result in more intuitive userland code around this type of functionality. Before I go any further in formalizing my proposal, I'd like to get feedback from list members. Thanks for your time. Bill Salak ------=_NextPart_000_0128_01D00709.BEDC19A0--