11 12
发新话题
打印

函数前面@的问题

函数前面@的问题

请问PHP中@除了不返回错误提示的作用外还有其他作用吗?

TOP

据俺目前的水平觉得应该没有其它作用

TOP

当然有其他作用了。
先占一楼。
广告位招租。

TOP

不过是负面作用罢了。。。

@符号抑制了错误后,会对程序执行的效率有一定的负面影响。
广告位招租。

TOP

哈哈,看来啥东西都会有副作用

TOP

楼上的这个话说的不全面,
应该是:看来啥东西都会有作用的。

就像一个哲人说过的,万物自有他存在的道理。
广告位招租。

TOP

第一:php.ini 中设置:error_reporting = E_ALL & ~ ( E_NOTICE ) 。如果还不想显示 warning 信息,只需要使用“|”运算符:error_reporting= E_ALL & ~ ( E_NOTICE | E_WARNING )。
第二,你代码首行写出以下范例
<?php

// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);

// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);

?>

TOP

再关注ing

再关注ing 非常谢谢楼主,顶一下

-------------------------
I love you not because of who you are, but because of who I am when I am with you.
我爱你,不是因为你是一个怎样的人,而是因为我喜欢与你在一起时的感觉。
Lineage2 powerleveling webpage:1.archlord gold,2.lineage2 adena,3.lotro powerleveling,4.Lineage2 powerleveling,5.age of conan gold,
爱相随

TOP

 11 12
发新话题