Re: [PHP] Boolean type forced on string assignment inside if statement
On Fri, Jan 4, 2013 at 1:56 AM, Sebastian Krebs wrote: > 2013/1/4 tamouse mailing lists >> Bit operators are not comparing values, they're COMBINING values. > > Technically spoken they're comparing bits, whereas boolean operators does > the same, but treaten every value as a single bit. And that's just going to confuse things. "Technically" speaking, bit operations and NOT logical operations. If you do this: if ($a & $b) when you meant this: if ($a && $b) it's because you got lucky, not because it's correct. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Boolean type forced on string assignment inside if statement
2013/1/4 tamouse mailing lists > On Fri, Jan 4, 2013 at 1:56 AM, Sebastian Krebs > wrote: > > 2013/1/4 tamouse mailing lists > >> Bit operators are not comparing values, they're COMBINING values. > > > > Technically spoken they're comparing bits, whereas boolean operators does > > the same, but treaten every value as a single bit. > > And that's just going to confuse things. "Technically" speaking, bit > operations and NOT logical operations. If you do this: > > if ($a & $b) > > when you meant this: > > if ($a && $b) > > it's because you got lucky, not because it's correct. > Sorry, but ... well, I don't understand you :X When I want "&&" and type "&" it's simply a bug, but sometimes I want "&", for example like in "$a & FLAG_ALLOWED", so I don't know, what you are talking about right now -- github.com/KingCrunch
Re: [PHP] Boolean type forced on string assignment inside if statement
On Fri, Jan 4, 2013 at 4:25 PM, Sebastian Krebs wrote: > 2013/1/4 tamouse mailing lists > >> On Fri, Jan 4, 2013 at 1:56 AM, Sebastian Krebs >> wrote: >> > 2013/1/4 tamouse mailing lists >> >> Bit operators are not comparing values, they're COMBINING values. >> > >> > Technically spoken they're comparing bits, whereas boolean operators does >> > the same, but treaten every value as a single bit. >> >> And that's just going to confuse things. "Technically" speaking, bit >> operations and NOT logical operations. If you do this: >> >> if ($a & $b) >> >> when you meant this: >> >> if ($a && $b) >> >> it's because you got lucky, not because it's correct. >> > > Sorry, but ... well, I don't understand you :X > > When I want "&&" and type "&" it's simply a bug, but sometimes I want "&", > for example like in "$a & FLAG_ALLOWED", so I don't know, what you are > talking about right now I'm talking about the first case, when it's a bug. Missing important words; "*and it works*, it's because you got lucky, not because it's correct" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pear Page2
Hello, Is there something similar to Pear/Page2 module, that can working with HTML5? Thanks for help, Greetings Silvio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pear Page2
On Fri, Jan 4, 2013 at 8:18 PM, Silvio Siefke wrote: > Is there something similar to Pear/Page2 module, that can working with HTML5? Would phptal be of use? http://phptal.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] variable placeholders in a text file
On Mon, Dec 31, 2012 at 02:29:38PM -0600, Nelson Green wrote: > > On Mon, 31 Dec 2012 19:59:02, Ashley Sheridan wrote: > ___ > > > > On Mon, 2012-12-31 at 13:39 -0600, Nelson Green wrote: > Nelson (et al), I've enjoyed reading this thread and apologize for dredging it up. It's interesting to see your progression of thought and the templating discussion is indeed a worthy one. However, I wanted to answer this objection from your initial message: >The reason I ask is because I am going to want to do three substitutions, >and I'd rather not do three str_replace calls if I don't have to. You *don't* have to; str_replace() is perfectly capable of handling arrays: = $replace = array("USER","SITENAME","SOME_CONSTANT"); $replacements = array($user,$site_name,$foo); $replaced = str_replace($replace,$replacements,file_get_contents("/somefile.txt")); = This, of course, doesn't negate a good templating system* ... but it's handy to know and you'll probably use it sooner or later. Kevin Kinsey P.S. *assuming that's not an oxymoron! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pear Page2
On Fri, 2013-01-04 at 20:44 -0600, tamouse mailing lists wrote: > On Fri, Jan 4, 2013 at 8:18 PM, Silvio Siefke wrote: > > Is there something similar to Pear/Page2 module, that can working with > > HTML5? > > Would phptal be of use? http://phptal.org/ > I'm not sure quite what you'd expect such a module to do? Is this for templating? Thanks, Ash http://www.ashleysheridan.co.uk