Re: [PHP] operators as callbacks?

2008-11-29 Thread Nathan Nobbe
On Sat, Nov 29, 2008 at 2:42 PM, Joe <[EMAIL PROTECTED]> wrote: > Is it possible to use a PHP operator as a callback? not that im aware of, even if you use the operator overloading extension, im not sure youll find that ability. I can use the BC library's math functions instead: > array_map('b

[PHP] operators as callbacks?

2008-11-29 Thread Joe
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