Hello: I have accepted a position outside of Columbia University, and no longer with CUMC Web Services. For further assistance:
New projects and follow up: Michael Sellers <ms4...@mail.cumc.columbia.edu> Technical Questions Perry Smith <ps2...@columbia.edu> Content Updates Setti Razavi <sr...@columbia.edu> Thanks, Dave New Contact Email: dy...@me.com ---------------- Original follows ---------------- >From talk-boun...@lists.nyphp.org Wed Nov 16 12:01:39 2011 Received: from ne1.stackware.com (ne1.stackware.com [64.64.3.54]) by jujube.cc.columbia.edu (8.14.4/8.14.3) with ESMTP id pAGH0Peq002390 for <jhy2...@columbia.edu>; Wed, 16 Nov 2011 12:00:30 -0500 (EST) Received: from ne1.stackware.com (localhost.localdomain [127.0.0.1]) by ne1.stackware.com (Postfix) with ESMTP id 96E524E408648; Wed, 16 Nov 2011 12:00:02 -0500 (EST) Received: from lists.nyphp.org (unknown [72.26.195.121]) by ne1.stackware.com (Postfix) with ESMTP; Wed, 16 Nov 2011 12:00:02 -0500 (EST) Received: from ct2.nyphp.com (localhost.localdomain [127.0.0.1]) by lists.nyphp.org (Postfix) with ESMTP id 710531CB0A8A; Wed, 16 Nov 2011 12:00:02 -0500 (EST) From: talk-requ...@lists.nyphp.org Subject: talk Digest, Vol 61, Issue 10 To: talk@lists.nyphp.org Reply-To: talk@lists.nyphp.org Date: Wed, 16 Nov 2011 12:00:01 -0500 Message-ID: <mailman.1.1321462801.32020.t...@lists.nyphp.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-BeenThere: talk@lists.nyphp.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: NYPHP Talk <talk.lists.nyphp.org> List-Unsubscribe: <http://lists.nyphp.org/mailman/options/talk>, <mailto:talk-requ...@lists.nyphp.org?subject=unsubscribe> List-Archive: <http://lists.nyphp.org/pipermail/talk> List-Post: <mailto:talk@lists.nyphp.org> List-Help: <mailto:talk-requ...@lists.nyphp.org?subject=help> List-Subscribe: <http://lists.nyphp.org/mailman/listinfo/talk>, <mailto:talk-requ...@lists.nyphp.org?subject=subscribe> Sender: talk-boun...@lists.nyphp.org Errors-To: talk-boun...@lists.nyphp.org X-Spam-Score: -1.5 () CU_LONEURI CU_OK_LISTUNSUB X-Scanned-By: MIMEDefang 2.68 on 128.59.28.170 Send talk mailing list submissions to talk@lists.nyphp.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.nyphp.org/mailman/listinfo/talk or, via email, send a message with subject or body 'help' to talk-requ...@lists.nyphp.org You can reach the person managing the list at talk-ow...@lists.nyphp.org When replying, please edit your Subject line so it is more specific than "Re: Contents of talk digest..." Today's Topics: 1. How does one suggest improved variable scoping for PHP? (Jim Williams) 2. Re: How does one suggest improved variable scoping for PHP? (Dan Cech) 3. Re: How does one suggest improved variable scoping for PHP? (Jeremy Mikola) ---------------------------------------------------------------------- Message: 1 Date: Wed, 16 Nov 2011 11:12:58 -0500 From: Jim Williams <j...@pagenotes.com> To: talk@lists.nyphp.org Subject: [nyphp-talk] How does one suggest improved variable scoping for PHP? Message-ID: <4ec3e10a.9030...@pagenotes.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed I just ran across a simple problem I couldn't solve, namely to create a function that does the opposite of array_filter, call it array_sanitize. The closest I could come doesn't work for anonymous functions: <?php function array_sanitize($array, $filterName) { $negFilter = create_function('$arg', 'return !'.$filterName.'($arg);'); return array_filter($array, $negFilter); } //Example: $a = array('a'=>6,'b'=>1,'c'=>4,'d'=>9); function isOdd($arg) { return $arg % 2 == 1; } print_r (array_sanitize($a, 'isOdd')); // outputs 'Array ( [a] => 6 ---------------- Remainder omitted here ---------------- _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation