国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

workerman 下使用 set_exception_handler 無效

stephen

發(fā)現(xiàn) workerman 下使用 set_exception_handler 設(shè)置異常捕捉無效

但在try...catch中可以捕捉,nginx fastcgi里面 set_exception_handler 正常,是什么原因?

<?php

use \BadFunctionCallException as BadFunctionCallException;
use \BadMethodCallException as BadMethodCallException;
use \DomainException as DomainException;
use \InvalidArgumentException as InvalidArgumentException;
use \LengthException as LengthException;
use \LogicException as LogicException;
use \OutOfBoundsException as OutOfBoundsException;
use \OutOfRangeException as OutOfRangeException;
use \OverflowException as OverflowException;
use \RangeException as RangeException;
use \RuntimeException as RuntimeException;
use \UnderflowException as UnderflowException;
use \UnexpectedValueException as UnexpectedValueException;

// 下面的方法在workerman無效,但在fastcgi有效。
set_exception_handler('exception_handler');

function exception_handler($e)
{
    // var_dump($e);
    echo '123';
}

// 以下代碼 workerman 中有效
// try{
//     new t;
// }catch(Exception $e){
//     echo $e->getMessage();
// }

class t{
    function __construct()
    {
        throw new BadMethodCallException('test');
    }
}

new t;
4353 1 0
1個回答

walkor 打賞

對,workerman里不支持set_exception_handler。

年代過于久遠,無法發(fā)表回答
??