Php 在herdoc中使用@error controller

Php 在herdoc中使用@error controller,php,heredoc,Php,Heredoc,如何在heredoc中使用@错误控制器?例如,我想重新显示尚未通过验证的输入表单字段的内容:我在herdoc中使用@时出错,如下所示: <<<EOS <input name="firstname" type="text" value="{@$_POST['firstname']}" /> EOS; Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecti

如何在heredoc中使用
@
错误控制器?例如,我想重新显示尚未通过验证的输入表单字段的内容:我在herdoc中使用
@
时出错,如下所示:

 <<<EOS
     <input name="firstname" type="text" value="{@$_POST['firstname']}" />
 EOS;

Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)

您不能在您的heredoc中执行此操作,但在此之前可以:

$value = @<<<HDOC
    Name: {$_POST['firstname']}
HDOC;

你为什么还需要
@
?那只不过是一个糟糕的设计。
$value = @"Name: {$_POST['firstname']}";