相关疑难解决方法(0)

Reference — What does this symbol mean in PHP?

What is this?

This is a collection of questions that come up every now and then about syntax in PHP. This is also a Community Wiki, so everyone is invited to participate in maintaining this list.

Why is this?

It used to be hard to find questions about operators and other syntax tokens.¹
The main idea is to have links to existing questions on Stack Overflow, so it's easier for us to reference them, not to copy over content from …

php arguments symbols operators

4314
推荐指数
21
解决办法
63万
查看次数

用PHP中的@运算符抑制错误

在您看来,使用@运算符来抑制PHP中的错误/警告是否有效,而您可能正在处理错误?

如果是这样,你会在什么情况下使用它?

欢迎使用代码示例.

编辑:回复者的注意事项.我不打算关闭错误报告,但是,例如,通常的做法是使用

@fopen($file);
Run Code Online (Sandbox Code Playgroud)

然后检查......但是你可以通过这样做摆脱@

if (file_exists($file))
{
    fopen($file);
}
else
{
    die('File not found');
}
Run Code Online (Sandbox Code Playgroud)

或类似的.

我想问题是 - 是否有任何@HAS用于抑制错误,不能以任何其他方式处理?

php error-suppression operators

68
推荐指数
7
解决办法
5万
查看次数

标签 统计

operators ×2

php ×2

arguments ×1

error-suppression ×1

symbols ×1