mpyw / exceper

Provides temporary error handler automatically using set_error_handler() and restore_error_handler().

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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'));
    }
}
commented

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.