tags:

views:

37

answers:

4

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 :(

+1  A: 

<<< is for heredoc: See manual

NullUserException
I had a space at end like: "<<<Order " ..thanks for showing me the manual. I would have never figured that out.
John Isaacks
What is the downvote for?
NullUserException
+2  A: 

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

nukefusion
This is exactly what it was. A single space at end of line 23.
John Isaacks
+2  A: 

Make sure that there is no SPACE/INDENTATION before ending ORDER;

Sarfraz
Clearly the closing identifier is not the problem.
NullUserException
A: 
David