0

Hi all,

I'm trying to use the following code to see if a method exists and then use it if it does:

$method_exists = method_exists('myclass', 'mymethod');

   if ($method_exists && isset(myclass::mymethod('blah')) {

but I am getting the following error:

Fatal error: Can't use function return value in write context

I've looked around on google and seen various explanations of why this could occur but none of them seem to make sense with this scenario.

Any light shed on the matter would be greatly appreciated.

Thanks

1
Contributor
1
Reply
7
Views
3 Years
Discussion Span
Last Post by Tinnin
0

isset(myclass::mymethod('blah')

is the problem. Can't check if the method call isset.

doh!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.