[PHP] assert()断言检测函数
2023-02-18 15:46:53 时间
assert_options函数 设置断言的参数
assert 函数 ,检测一个断言
<?php // 激活断言,并设置它为 quiet assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_WARNING, 0); assert_options(ASSERT_QUIET_EVAL, 1); // 设置回调函数 assert_options(ASSERT_CALLBACK, 'my_assert_handler'); // 让一则断言失败 assert('mysql_query("")'); //创建处理函数 function my_assert_handler($file, $line, $code) { echo "error: File '$file' Line '$line' Code '$code'"; }
相关文章
- 论文解读(GraRep)《GraRep: Learning Graph Representations with Global Structural Information》
- 邻接矩阵、度矩阵
- 机器学习最困难的部分:超参数调试
- 分类中解决类别不平衡问题
- 论文解读(SDNE)《Structural Deep Network Embedding》
- 分类任务中性能度量及代码
- 对数函数和指数函数
- 凸优化课件参考
- 矩阵求导
- 性能度量
- 行空间、列空间、零空间
- 论文解读(LLE)《Nonlinear Dimensionality Reduction by Locally Linear Embedding》以及论文通俗解释
- 等度量映射ISOMAP
- 论文解读(LINE)《LINE: Large-scale Information Network Embedding》
- 分类问题中的类别不平衡-总结
- Ubuntu20.04 换源
- 论文解读(DeepWalk)《DeepWalk: Online Learning of Social Representations》
- Ubuntu命令行快捷启动Pycharm
- ubuntu20.04 如何禁用触摸板
- Ubuntu命令卸载软件