While working on an existing Drupal site I’ve noticed a strange glitch that causes any PHP operator with > in it to act like a ?> tag. This is happening in in Drupal pages that I create that have a ‘Input Format’ of ‘PHP code’.
For example this line of code
foreach($array as $key => $value){
results in a very broken page that prints out
$value){
Does any one know what could be causing this? My Dev environment is XAMPP. Drupal version is 6.15. PHP version is 5.2.9.
UPDATE: Short tags are OFF and when the PHP is rewritten so that it contains no > char it works as expected. I’ll have to test more to get additional information.
If you look in the source, I bet you see the rest of the foreach in there. It’s treating
>as an HTML end delimiter (and it found a<earlier in the script). Ensure PHP is being parsed. If it isn’t being parsed, see if it’s because the script requires short tags. If the script uses long tags, make sure PHP itself is up and running properly in the web server.