您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php异常处理类

2026/1/3 5:14:25发布14次查看
```getmessage().'in file:'.$this->getfile().'on line:'.$this->getline(); }}function reg($reginfo = null){ // 依据不同错误抛出不同异常 if (empty($reginfo) || !isset($reginfo)) { throw new exception('参数非法'); } if (empty($reginfo['email'])) { throw new emailexception('邮件为空'); } if ($reginfo['pwd'] != $reginfo['repwd']) { throw new pwdexception('两次密码不一致!'); }}// 接收不同异常,并针对性处理!try { reg(array('email' => '1078789950@qq.com', 'pwd' => '123', 'repwd' => '1231' ));} catch (exception $e) { echo $e ->getmessage();} catch (emailexception $ee) { echo $ee ->getmessage();} catch (pwdexception $ep) { echo $ep;}```
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product