// 开启报错提醒
ini_set("display_errors", "On");
error_reporting(E_ALL | E_STRICT);

// 某一段代码查找异常

<?php
//创建可抛出一个异常的函数
function checkNum($number)
{
if($number>1)
{
throw new Exception("Value must be 1 or below");
}
return true;
} //在 "try" 代码块中触发异常
try
{
checkNum(2);
//If the exception is thrown, this text will not be shown
echo 'If you see this, the number is 1 or below';
} //捕获异常
catch(Exception $e)
{
echo 'Message: ' .$e->getMessage();
}
?>

最新文章

  1. docker快速入门+搭建javaweb环境
  2. JavaScript----分层导航 滚动事件
  3. 350. Intersection of Two Arrays II
  4. 栈和队列的面试题Java
  5. the private key for is not installed on this mac
  6. 使用MJRefresh遇到的坑
  7. Haskell 几乎无疼痛入门指南
  8. Android checkbox和radiobutton 以及Toast和AlertDialog的使用
  9. Spring思维导图(MVC篇)
  10. 自己写的一个vii总结
  11. centos7安装eclipse方法
  12. Python菜鸟快乐游戏编程_pygame(2)
  13. 边框回归(bounding-Box regression)
  14. RequireJS - 个人小入门
  15. java Web三大组件--监听器
  16. 给已经存在的项目添加git
  17. Python基础10_函数
  18. uploadify onComplete 不执行?
  19. Spring事务管理—aop:pointcut expression 常见切入点表达式及事物说明
  20. tar 解压命令学习与总结

热门文章

  1. Git出错:“Please make sure you have the correct access rights and the repository exists.”
  2. Golang语言系列-12-网络编程
  3. Git连接github以及gitee等使用教程
  4. Nikitosh 和异或
  5. 如何快速排查发现redis的bigkey?4种方案一次性给到你!
  6. [ES6深度解析]14:子类 Subclassing
  7. wpf 滚动文字 跑马灯
  8. 【java虚拟机】jvm调优原则
  9. GPIO引脚速度的应用匹配
  10. 初识javaScript(慕课网学习笔记)