Callback should be called by call_user_func
chitoku-k opened this issue · comments
Core::handle
calls $callback
directly but this is inconvenient in following case when using in PHP < 5.4.
<?php
use mpyw\Exceper\Convert;
class Foo
{
public function that() {}
public function bar()
{
Convert::toErrorException(array($this, 'that'));
}
}
F*ck PHP 5.3
Online PHP editor | output for oqHuD https://3v4l.org/oqHuD
I actually encountered this situation in my ancient environment, which does not allow use of $this
inside closure.