Marc Weber wrote:
> 
> Why can't I use static functions in array_map?
> 
> Example:
> 
> <?php
> class Dummy
> {
>   static public function T($a)
>   {
>     echo "T called with $a\n";
>     return $a+2;
>   }
> }
> 
> function t($a)
> {
>   echo "t called with $a\n";
>   return $a*2;
> }
> 
> echo 'invoking Dummy::T works fine : ', Dummy::T(3),"\n";
> var_dump(array_map('t',array(1,2)));
> var_dump(array_map('Dummy::T',array(1,2)));


do it like this:

var_dump(array_map(array("Dummy","T"), array(1,2)));

> ?>
> 
> Marc
> 
> --PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to