assert_options函数 设置断言的参数
assert 函数 ,检测一个断言
<?php// 激活断言,并设置它为 quietassert_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‘";}
[PHP] assert()断言检测函数
原文地址:https://www.cnblogs.com/taoshihan/p/10531744.html