Re: [PHP] Re: operators as callbacks?

2008-11-30 Thread Nathan Nobbe
On Sat, Nov 29, 2008 at 5:59 PM, Martin Zvarík <[EMAIL PROTECTED]> wrote: > Joe napsal(a): > >> 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 does

[PHP] Re: operators as callbacks?

2008-11-29 Thread Martin Zvarík
Joe napsal(a): 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 function