<?
<beginfold id='1'>/*</beginfold id='1'> This is a pseudo PHP file to test Kate's PHP syntax highlighting. <endfold id='1'>*/</endfold id='1'>
# TODO: this is incomplete, add more syntax examples!
# this is also a comment.
// Even this is a comment
function test($varname) <beginfold id='2'>{</beginfold id='2'>
	return "bla";	# this is also a comment
<endfold id='2'>}</endfold id='2'>

?>

<?php echo("hello test"); ?>

<html>
	<? print "<title>test</title>"; ?>

	<beginfold id='3'><!--</beginfold id='3'> CSS <endfold id='3'>--></endfold id='3'>
	<beginfold id='4'><style</beginfold id='4'>>
		.inputText <beginfold id='5'>{</beginfold id='5'>
			width: <?php echo $width; ?>px;
			text-indent: 10px;
		<endfold id='5'>}</endfold id='5'>
	<endfold id='4'></style</endfold id='4'>>

	<beginfold id='3'><!--</beginfold id='3'> JavaScript <endfold id='3'>--></endfold id='3'>
	<beginfold id='6'><script</beginfold id='6'>>
		var some_js_var = <?php echo $somevar; ?> ;
		<?php echo 'alert("Hello there.");'; ?>
	<endfold id='6'></script</endfold id='6'>>
	<beginfold id='3'><!--</beginfold id='3'> JavaScript React <endfold id='3'>--></endfold id='3'>
	<beginfold id='6'><script</beginfold id='6'> type="text/babel">
		<beginfold id='7'><Hello</beginfold id='7'>> <?php echo("Hello, hello!"); ?> </Hello<endfold id='7'>></endfold id='7'> <?php <beginfold id='1'>/*</beginfold id='1'> aaa <endfold id='1'>*/</endfold id='1'> ?> <beginfold id='8'><div</beginfold id='8'>></div<endfold id='8'>></endfold id='8'>
		function a(i) <beginfold id='9'>{</beginfold id='9'>
			<?php echo "var j = 1;"; ?>
			return <beginfold id='8'><p</beginfold id='8'>><beginfold id='10'>{</beginfold id='10'> i + j <endfold id='10'>}</endfold id='10'></p<endfold id='8'>></endfold id='8'>;
		<endfold id='9'>}</endfold id='9'>
	<endfold id='6'></script</endfold id='6'>>
	<beginfold id='3'><!--</beginfold id='3'> TypeScript <endfold id='3'>--></endfold id='3'>
	<beginfold id='6'><script</beginfold id='6'> type="text/typescript">
		<?php $timestamp = time(); ?>
		class DateTime <beginfold id='11'>{</beginfold id='11'>
			info: string;
			constructor() <beginfold id='11'>{</beginfold id='11'> this.info = <?php echo(date("F d, Y h:i:s", $timestamp)); ?>; <endfold id='11'>}</endfold id='11'>
			get() <beginfold id='11'>{</beginfold id='11'> return this.info; <endfold id='11'>}</endfold id='11'>
		<endfold id='11'>}</endfold id='11'>
	<endfold id='6'></script</endfold id='6'>>
	<beginfold id='3'><!--</beginfold id='3'> MustacheJS <endfold id='3'>--></endfold id='3'>
	<beginfold id='6'><script</beginfold id='6'> type="x-tmpl-mustache">
		<beginfold id='12'>{{!</beginfold id='12'> <?php print "comment"; ?> <endfold id='12'>}}</endfold id='12'>
		<beginfold id='13'>{{#movie</beginfold id='13'>}}
			<beginfold id='14'><div</beginfold id='14'>>
				<h1>{{title}}</h1>
				<img src="{{poster}}" alt="{{title}}"/>
				<?php echo $movierating; ?> - {{ratings.critics_rating}}
			<endfold id='14'></div</endfold id='14'>>
		<endfold id='13'>{{/movie}}</endfold id='13'>
	<endfold id='6'></script</endfold id='6'>>

</html>

<?php
$var = <beginfold id='15'><<<DOOH</beginfold id='15'>
This is the $string inside the variable (which seems to be rendered as a string)
It works well, I think.
<endfold id='15'>DOOH</endfold id='15'>

# bug 382527
throw new ParserException("Test {$this->some_var[$index]}\nin {$this->file} is missing.\nThis is bad.");

$arr = array();
foreach($arr as $i => $v)<beginfold id='16'>:</beginfold id='16'>
	echo($i);
<endfold id='16'>endforeach</endfold id='16'>
?>
