Topic: Else if syntax

Ok, this is not really a bug, but rather a syntax improvement suggestion

In extensions.php I found this

// Uninstall an extension
else if (isset($_POST['uninstall']))

Wouldn't it be better with some real php syntax like this

// Uninstall an extension
elseif (isset($_POST['uninstall']))

I havn't checked, but I suspect that this syntax can be found elsewhere in the code.

ref:http://se.php.net/manual/en/control-structures.elseif.php

Re: Else if syntax

Moved to PunBB Discussion
Why should it be changed? They do exactly the same thing and "else if" is easier to read than "elseif" (at least IMO). And just because "elseif" is the title of the page as opposed to "else if," it doesn't mean that one is more "real" than the other

Re: Else if syntax

In PHP, you can also write 'else if' (in two words) and the behavior would be identical to the one of 'elseif' (in a single word). The syntactic meaning is slightly different (if you're familiar with C, this is the same behavior) but the bottom line is that both would result in exactly the same behavior.

To quote your reference

Re: Else if syntax

Connorhd wrote:

In PHP, you can also write 'else if' (in two words) and the behavior would be identical to the one of 'elseif' (in a single word). The syntactic meaning is slightly different (if you're familiar with C, this is the same behavior) but the bottom line is that both would result in exactly the same behavior.

To quote your reference

Yes, I'm aware of that, I also mentioned that this wasn't a bug.

Re: Else if syntax

Sonrep wrote:
Connorhd wrote:

In PHP, you can also write 'else if' (in two words) and the behavior would be identical to the one of 'elseif' (in a single word). The syntactic meaning is slightly different (if you're familiar with C, this is the same behavior) but the bottom line is that both would result in exactly the same behavior.

To quote your reference

Yes, I'm aware of that, I also mentioned that this wasn't a bug.

I think his question was, why bring it up at all?

Re: Else if syntax

its all a matter of style / what you are in the habit of doing.  I always use <?= $myvar ?> inside html instead of <? echo $myvar ?> but wouldn't suggest that everyone code like me.

#comment
if $q == 1:
endif

feels much too much like bourne shell scripting, and much like vb, I cant stand that.