Wrapper class: How to get rid of call_user_func_array() warning?

As you have noticed already, $this will not work as you expected prior to PHP 5.4. You can read this in the PHP wiki. The reason:

For PHP 5.3 $this support for Closures was removed because no consensus could be reached how to implement it in a sane fashion. This RFC describes the possible roads that can be taken to implement it in the next PHP version.

An easy workaround is to simple copy $this up front, then use the new reference/ variable:

$subject = clone $this;

Leave a Comment