fenom-template / fenom

Template Engine for PHP. Maintainers wanted!
Other
446 stars 108 forks source link

Inconsistent codestyle #13

Closed creocoder closed 9 years ago

creocoder commented 11 years ago

For example:

$scope["else"]

can be replaced with

$scope['else']

Why you use " without interpolation needs? Its:

Can you replace all " with ' in cases when you do NOT need interpolation? Thanks.

creocoder commented 11 years ago

@bzick Any news on this? At least you agree with that or not?

bzick commented 11 years ago

The quotes are parsed during the generating the opcode. This means that the opcode no difference with what was quoted string. This opcode can be successfully cached (http sapi) or executed (cli sapi). This improvement can be accelerated only when loading PHP file. Therefore, should be used templates exactly single-quote. Fenom can rewrite gradually (shadow-refactoring). PS I'm on vacation in another country, so the answer is slowly.

creocoder commented 11 years ago

@bzick Anyway i have no idea why you use " when you do not need string interpolation. This fact for example stop me from using this lib. But i like it anyway. Will you accept PR with " => ' when interpolation is not needed?

bzick commented 11 years ago

I think needed, if it realy so faster. Do you have some perfomence results?

creocoder commented 11 years ago

@bzick In reality there is no "speed" aspect. There is "ideological" and "accuracy" aspect. Knowing that man who write lib make all that he can motivate its users to make extensions for it, contribute to it, etc.

bzick commented 9 years ago

is not a problem and there is no appreciable profit. So, if nobody wants to do - close