Re: What else can cause "unexpected T_SL" error other than heredoc?

From: Date: Thu, 25 Nov 2004 12:26:22 +0000
Subject: Re: What else can cause "unexpected T_SL" error other than heredoc?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-202845@lists.php.net to get a copy of this message
On Thu, 25 Nov 2004 12:17:01 +0000, D. D. Brierton <darren@dzr-web.com> wrote: > We've been getting the following error: > > [error] PHP Parse error: parse error, unexpected T_SL in > /foo/bar.php on line 136 Can you post some of this code? Are all your heredoc instances completely left justified? > (where foo and bar obviously are stand-ins for real values). > > The weird thing is that the file generating the error, bar.php, DOESN'T > contain any heredoc quotations. bar.php was being called by another file, > let's call it baz.php with require_once, and baz.php was also calling > other files using require_once which DID include heredoc quotations, let's > call them heredoc1.php and heredoc2.php. I was able to determine that the > problem was indeed caused by bar.php, and not by anything in heredoc1.php > or heredoc2.php by testing in the following way: > > Testing baz.php with the the following commented out: > > require_once 'bar.php'; > // require_once 'heredoc1.php'; > // require_once 'heredoc2.php'; > > Then testing baz.php with the following commented out: > > // require_once 'bar.php'; > require_once 'heredoc1.php'; > require_once 'heredoc2.php'; > > In the first test the "unexpected T_SL" error persisted, whereas in the > second it went away. > > But, bar.php does NOT contain any heredoc quoted strings, nor does it > contain anywhere the strings "<<" or ">>". So what could be the > cause of > the T_SL error? I dunno if that's just a typo in your post, but heredoc requires 3 <<< or >>>, not two as you wrote. Are you using any sort of PHP cache by chance? -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/

« previous php.general (#202845) next »