NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
phped goes berserk when END syntax is used


Joined: 23 May 2004
Posts: 2
Reply with quote
for example:

Code:

<?php
$html = <<<END
<script type='text/javascript'>
<!--
var blah=1;
//-->
</script>
END;

echo $html;
$flag=true;
...etc
?>


try that code out and you will see that phped starts to greying the wrong codes
View user's profileFind all posts by tihpSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
that's because of
Quote:
</script>
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 23 May 2004
Posts: 2
Reply with quote
is there any chance you could fix that problem in the future release?
View user's profileFind all posts by tihpSend private message


Joined: 06 Oct 2003
Posts: 13
Reply with quote
ddmitrie wrote:
that's because of
Quote:
</script>


geez bad bug. let's be clear about something... the bug is not caused by having "</script>" in the code. it's caused by the syntax highlighting engine and its inability to deal with this particular (and perfectly valid) PHP syntax.
View user's profileFind all posts by nebySend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Yep, right. Phped 3.3 highlighter can't handle HEREDOC statements properly. It just ignores them.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 06 Oct 2003
Posts: 13
Reply with quote
in case it helps, i think that 5.0 and 5.5 versions of macromedia homesite had a highlighter that handled it just fine. maybe other versions too, those were the only ones i ever used.

(digression follows...) for that matter, i think those versions of homesite had the best php syntax highlighting i've ever seen by a good margin. it could highlight heredoc strings and had a specific color setting for them. it could highlight both html and php in the same file simultaneously- as opposed to just greying out one or the other.

the best part was, to help you differentiate between html and php code, it could background-highlight all php code. that is, it would do everything between opening and closing php tags in your background color of choice.
View user's profileFind all posts by nebySend private message
phped goes berserk when END syntax is used
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic