Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse error: syntax error, unexpected T_SL on line 23

Tags:

I am getting this error:

Parse error: syntax error, unexpected T_SL on line 23

Here is line 23:

$selectorder = <<<ORDER  

Here it is in context:

$grid->setUrl('myfirstgrid.php');  $selectorder = <<<ORDER  function(rowid, selected)  {      if(rowid != null) {          alert("selected: "+rowid);      }  }  ORDER; $grid->setGridEvent('onSelectRow', $selectorder); 

What is causing this error?

I personally don't know what <<< does and have never used it, I got it from a tutorial. I tried to google it, but you can't google characters like that :(

like image 703
JD Isaacks Avatar asked Aug 06 '10 15:08

JD Isaacks


People also ask

What is syntax error Unexpected T_function?

This error is basically indicating you that there’s something wrong in one of your functions. Most of the times, you should also get the exact located of where the error actually appears – Parse error: syntax error, unexpected T_FUNCTION in /public_html/wp-content/themes/custom-theme-name/functions.php on line 123.

What is syntax error syntax error Unexpected end in WordPress?

Parse error syntax error unexpected end in WordPress can be the simplest of errors and still cause a big problem. The error has two parts: Syntax Error– This error is caused by an error in the PHP structure when a character is missing or added that shouldn’t be there.

Why do I get syntax error when installing plugins?

Many times, when installing a new plugin or theme, you may encounter the Parse error: syntax error, unexpected T_FUNCTION error. This error is basically indicating you that there’s something wrong in one of your functions.

What is a parse error in PHP?

A parse error: syntax error, unexpected appears when the PHP interpreter detects a missing element. Most of the time, it is caused by a missing curly bracket “}”. To solve this, it will require you to scan the entire file to find the source of the error.


2 Answers

Check for whitespace after <<<ORDER. There should be no blank characters.

like image 114
Matt B Avatar answered Sep 28 '22 09:09

Matt B


<<< is for heredoc: See manual

like image 35
NullUserException Avatar answered Sep 28 '22 07:09

NullUserException