Hello. I am working on a PHP project. There, I often use following syntax to output text in a cluase:
if($boolean){
?>
output text
<?
}else{
?>
alternative
<?
}
On my computer, this works perfectly well. I use XAMPP foer Mac OS X. But when I send the files to my coworker, these outputs often do not work and the compiler complains about having reached an unexpected $end of file. This occurs especially often when there is a tag in the output. We have to replace the means of output with echo.
What's the reason for this strange behavior of the compiler? Is the above-mention syntax of outputting text wrong?