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 :(
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.
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.
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.
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.
Check for whitespace after <<<ORDER
. There should be no blank characters.
<<<
is for heredoc: See manual
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With