[nycphp-talk] talk Digest, Vol 61, Issue 10
jhy2104 at columbia.edu
jhy2104 at columbia.edu
Wed Nov 16 12:01:41 EST 2011
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 <ms4274 at mail.cumc.columbia.edu>
Technical Questions
Perry Smith <ps2200 at columbia.edu>
Content Updates
Setti Razavi <sr150 at columbia.edu>
Thanks,
Dave
New Contact Email: dyoun at me.com
---------------- Original follows ----------------
>From talk-bounces at 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 <jhy2104 at 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-request at lists.nyphp.org
Subject: talk Digest, Vol 61, Issue 10
To: talk at lists.nyphp.org
Reply-To: talk at lists.nyphp.org
Date: Wed, 16 Nov 2011 12:00:01 -0500
Message-ID: <mailman.1.1321462801.32020.talk at lists.nyphp.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-BeenThere: talk at 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-request at lists.nyphp.org?subject=unsubscribe>
List-Archive: <http://lists.nyphp.org/pipermail/talk>
List-Post: <mailto:talk at lists.nyphp.org>
List-Help: <mailto:talk-request at lists.nyphp.org?subject=help>
List-Subscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
<mailto:talk-request at lists.nyphp.org?subject=subscribe>
Sender: talk-bounces at lists.nyphp.org
Errors-To: talk-bounces at 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 at 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-request at lists.nyphp.org
You can reach the person managing the list at
talk-owner at 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 <jim at pagenotes.com>
To: talk at lists.nyphp.org
Subject: [nycphp-talk] How does one suggest improved variable scoping
for PHP?
Message-ID: <4EC3E10A.9030905 at 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 ----------------
More information about the talk
mailing list