Is ReflectionMethod's getClosure() function available...?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I was hoping someone might be able to answer this question, because
everywhere I have looked it seems like no one else has had this

I've run into an issue recently in development of a PHP application
where the PHP interpreter is claiming that
ReflectionMethod::getClosure is not a valid method call. While I ave
found some useful code on PHP's site in the user comments regarding
reflection that looks to relieve the dependency necessarily on PHP
5.3, I am trying to determine whether something has changed with the
ReflectionMethod's getClosure() method implementation or not.

Unfortunately at the moment of writing this I don't have the PHP
executable info dump, nor the error message in front of me. However
the version of the PHP executable I was using was one of the more
recent Windows binary snapshots for PHP 5.3 (I believe it was RC3-

So I'm mostly looking for a sanity check here, that the getClosure()
method is being added to the ReflectionMethod class in PHP 5.3. As I
said, everything seems to corroborate that it is getting added but my
experiences would seem to reject this.

Thanks, for any clarification on this matter.

Re: Is ReflectionMethod's getClosure() function available...?

Quoted text here. Click to load it

As a clarification, because I realized it was unclear by my initial
post. I am trying to get the closure in the following manner:

$reflectionClass = new ReflectionClass('XyzClass');
$method = $reflectionClass->getMethod('method');
$closure = $method->getClosure();

It is the `$method->getClosure()' call that is blowing up in my face.

Sorry for any confusion in my original message.


Site Timeline