Saikios
Saikios

Reputation: 3711

Error with __Call on magento

I can't figure this out,

I have a method on my class like:

public function __call($closure, $args){
     return call_user_func_array($this->{$closure}->bindTo($this),$args);
}

This works on my local server on magento, but when I try to use it on my server it returns me the following error:

Fatal error: Call to undefined method Closure::bindTo() in

I tried adding var_dump to the variables, all have the correct values.

Any ideas?

Upvotes: 1

Views: 50

Answers (1)

Shira
Shira

Reputation: 6560

Closure::bindTo exists in PHP 5.4 or newer only. Check your PHP version.

http://php.net/manual/en/closure.bindto.php

Upvotes: 1

Related Questions