Re: How to get the 'return type' of a function?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/2/23 Dasn <dasn@xxxxxxxxxxx>:
> Hello guys, I try to use 'ReflectionFunction' to retrieve the info of a
> function.
> For example:
> <?php
>
> $rf = new ReflectionFunction('strstr');
> echo $rf;
> ?>
> =============== output ==================
>
> Function [ <internal:standard> function strstr ] {
>
>  - Parameters [3] {
>    Parameter #0 [ <required> $haystack ]
>    Parameter #1 [ <required> $needle ]
>    Parameter #2 [ <optional> $part ]
>  }
> }
>
> The problem is there's no 'return type' (i.e. 'string' in this example)
> info about the function.
>
> Could you tell me how to retrieve the 'return type'?
> Thanks.
I think PHP doesnt support it.

In ReflectionParameter class you'll see there is no parameter type too.

May be this is because PHP is loosely typed language.

-- 
Shiplu Mokaddim
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://groups.google.com/group/p2psust
Innovation distinguishes bet ... ... (ask Steve Jobs the rest)

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux