I’m stumped. I’ve been using EE for years but this problem has got me running around in circles.
It’s simple, just set a template to PHP enabled and OUTPUT and then add this code in:
<?php $seg1 = TRUE; ?>
{if "{segment_1}" == "doggy"}
<?php
$seg1 = FALSE;
echo 'DOGGY';
?>
{/if}
<?php echo ($seg1) ? "Seg1 is TRUE" : "Seg1 is FALSE"; ?>Ok, so we have a SIMPLE CONDITIONAL which should parse before PHP. Go to a the page, and make sure segment_1 doesn’t have doggy in it. You’ll notice that “DOGGY” doesn’t print out, which is expected! But then you’ll see that “Seg1 is FALSE” is echoed out!
This doesn’t make any sense to me. Why is the PHP code that sets $seg1 to false being executed when it isn’t supposed to AND when the echo statement isn’t being executed?
Can anyone else reproduce this? I’m using version 2.5.3.
(p.s. really annoyed with EE not having the tech support section anyone, but hopefully the community is as good as it used to be)