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.
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 …
在写字:
$name = @$_GET['name'];
Run Code Online (Sandbox Code Playgroud)
代替:
$name = isset($_GET['name']) ? $_GET['name'] : null;
Run Code Online (Sandbox Code Playgroud)
是一些糟糕的编码习惯?我可以将@用作普通算子或仅在某些特定情况下使用吗?