E
E
ebbk2021-06-17 14:14:11
PHP
ebbk, 2021-06-17 14:14:11

Why does it give T_ENCAPSED_AND_WHITESPACE error?

On one server, this code works without errors, when I put on another there are a bunch of errors, error after error.
tell me what to do.

Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in editor.php on line 56

Here is his location
if($mass){
    echo <<<HTML
      <div class="alert alert-success alert-styled-left alert-arrow-left alert-component message_box">
        <h4>Изменения сохранены</h4>
        <div class="panel-body">
          <table width="100%">
            <tbody>
              <tr>
                <td height="80" class="text-center">Изменения были успешно сохранены</td>
              </tr>
            </tbody>
          </table>
        </div>
        <div class="panel-footer">
          <div class="text-center"><a class="btn btn-sm bg-teal btn-raised position-left legitRipple" href="/{$config['admin_path']}?mod=zvuk-editor{$pag_plus}">Перейти к списку публикаций</a></div>
        </div>
      </div>
    HTML;


} elseif (!isset($_GET['edit'])) {  //ТУТ ОШИБКА СТАВЛЮ 1==1 НОРМ НО ОШИБКА ВОЗНИКАЕТ ИМЕННО В ТАКИХ МЕСТАХ

echo <<<HTML
<div class="navbar navbar-default navbar-component navbar-xs systemsettings">
<div class="navbar-collapse collapse" id="navbar-filter">
    <ul class="nav navbar-nav">
      <li {$artists_active}><a href="{$config['admin_path']}?mod=zvuk-editor" class="tip legitRipple"><i class="fa fa-user-circle-o"></i> Артисты</a></li>
      <li {$album_active}><a href="{$config['admin_path']}?mod=zvuk-editor&type=albums" class="tip legitRipple"><i class="fa fa-shield"></i> Альбомы</a></li>
    </ul>
  </div>
</div>
HTML;

}


A lot of errors occur in places exactly in one server, in another everything is fine
elseif (!isset($_GET['edit']))
$str = 'String'. $peremennaya. 'String';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2021-06-17
@ebbk

A parsing error means that the servers have different versions of PHP.
Specifically - on the one where the error occurs version less than 7.3 .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question