php-general Digest 29 Nov 2008 23:10:09 -0000 Issue 5817

Topics (messages 283913 through 283917):

Something to lighten the mood...
        283913 by: Richard Heyes
        283914 by: Nathan Rixham
        283915 by: Nathan Rixham
        283916 by: Daniel P. Brown

operators as callbacks?
        283917 by: Joe

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Just read this:

How many Google Chrome users does it take to change a lightbulb?
None. The lightbulb is isolated, so if it fails, the room doesn't go dark.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated November 29th)

--- End Message ---
--- Begin Message ---
Richard Heyes wrote:
Just read this:

How many Google Chrome users does it take to change a lightbulb?
None. The lightbulb is isolated, so if it fails, the room doesn't go dark.


rbh I'm most impressed with your remote php-general-list mood detection script - how did you know?
--- End Message ---
--- Begin Message ---
Richard Heyes wrote:
Just read this:

How many Google Chrome users does it take to change a lightbulb?
None. The lightbulb is isolated, so if it fails, the room doesn't go dark.


tbh I'm most impressed with your remote php-general-list mood detection script - how did you know?
--- End Message ---
--- Begin Message ---
On Sat, Nov 29, 2008 at 3:25 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote:
>
> tbh I'm most impressed with your remote php-general-list mood detection
> script - how did you know?

    And here, when you said 'RBH' the first time, I thought you knew
Richard's middle name.

-- 
</Daniel P. Brown>
http://www.parasane.net/
[EMAIL PROTECTED] || [EMAIL PROTECTED]
50% Off Hosting! http://www.pilotpig.net/specials.php

--- End Message ---
--- Begin Message ---
Is it possible to use a PHP operator as a callback? Suppose I want to add two
arrays elementwise, I want to be able to do something like this:
 array_map('+', $array1, $array2)
but this doesn't work as "+" is an operator and not a function.

I can use the BC library's math functions instead:
 array_map('bcadd', $array1, $array2)
but that is an ugly hack that might break if the library is not available.

I can create an anonymous function:
 array_map(create_function('$a, $b', 'return $a + $b;'), $array1, $array2)
but that seems really unnecessarily verbose.

Is there any simple clean way to do it? Thanks,



--- End Message ---

Reply via email to