Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Bitwise comparison

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
Karel S.
Smarty Rookie


Joined: 03 Aug 2009
Posts: 26
Location: The Netherlands

PostPosted: Wed Aug 12, 2009 2:41 pm    Post subject: Bitwise comparison Reply with quote

Right now I'm porting Smarty 2 templates to Smarty 3.
For some reason I can't do a bitwise comparison (works fine in Smarty 2.6).

Code:

{if ($level & MASK) > NO_ACCESS}
  //
{/if}


I get this message:

Unexpected "& ", expected one of: "==" , "!=" , "(>,GT)" , "(<,LT)" , "(>=,GE)" , "(<=,LE)" , "===" , "!=="

Error: Syntax Error in template "/var/.../index.html"
File: /var/.../smarty/sysplugins/internal.templatecompilerbase.php
Line: 264
Back to top
View user's profile Send private message
Karel S.
Smarty Rookie


Joined: 03 Aug 2009
Posts: 26
Location: The Netherlands

PostPosted: Wed Aug 12, 2009 3:22 pm    Post subject: Reply with quote

And got this error:

Code:

{if $iCountryId == 1 || $iCountryId == 2}
  //
{/if}


Error: Syntax Error in template "/var/.../index.html" on line 84 "{if $iCountryId == 1 || $iCountryId == 2}" - Unexpected "= ", expected one of: INTEGER , "+" , "-" , "(" , "[" , "$" , "identifier" , """ , "'" , "boolean" , "null" , "#"
File: /var/.../sysplugins/internal.templatecompilerbase.php
Line: 264
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5067
Location: Hamburg / Germany

PostPosted: Wed Aug 12, 2009 5:20 pm    Post subject: Reply with quote

Bit operations have not been implemented in Smarty 3. This was dropped in some early discusions.

Your second error was introduced by yesterdays update. It is fixed with todays update of the SVN.
Back to top
View user's profile Send private message
Karel S.
Smarty Rookie


Joined: 03 Aug 2009
Posts: 26
Location: The Netherlands

PostPosted: Thu Aug 13, 2009 3:11 pm    Post subject: Reply with quote

Quote:
Bit operations have not been implemented in Smarty 3. This was dropped in some early discusions.


Didn't known that. No problem.

Quote:
Your second error was introduced by yesterdays update. It is fixed with todays update of the SVN.


Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP