php-general@lists.php.net
probably priority issue. try: if (($One & $Two) == $One) - - in your example this means: ((0100 & ) == 0100) (0100 == 0100) TRUE ...in other case 0100 & ( == 0100) is 0100 & 0 is always 0 hope this helps Buchholz "Fred" wrote > From: "Fred" <[EMAIL PROTECTED]> > Date: Mon, 19 Nov 2001 18:02:53 -0800 > Subject: [PHP] Bitwise & > > I have 17 boolean variables which need to be stored in a MySQL database. I > created a SET Column to store each of the boolean values as bits in the > column. I should be able to test for the truth of a particular variable by > checking if the corresponding bit is set. > > For example, if the first four variables are set (i.e. Column = a,b,c,d) > then the numeric value of the column is 15 or . To test for c I would > check to see if the third bit (4 or 100) is set. > > I chose to do the check this way: > > if ($One & $Two == $One) echo "True"; > > This does not seem to work in many instances. Take the example above: > 4 and 15 should equal 4 > 0100 and > equals > 0100 > > For some reason, my script gives as the result of 0100 and . It is > fairly clear that this is not the correct behavior of the bitwise & > operator. > > Oddly enough, in some instances is works as expected: > 16 and 17 should equal 16 > 1 and > 10001 equals > 1 > > My script has no problem generating the expected result here. > > Perhaps this problem arises from the loosely typed nature of PHP variables, > but I do not see how it could. Any pointers would be appreciated. > > Fred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to increase number of supported servers?
Notice: Jay´s reply to my post yesterday was only a little mistake while asking his own different question (he corrected this immediatly reposting his message as thread '[PHP] what does this mean?' and got some answers). So keep in mind plaese, the original question '... number of supported servers' still fills my heads space... ;) Thanks for your attention again. I´m keep on trying to figure out a solution meanwhile looking into the code. --Buchholz > what does this mean? > > Warning: Cannot use a scalar value as an array > > I look at the line that is causing the warning and it's this: > > $errorMsg["error"] = ""; > > thanks, > jay > > [EMAIL PROTECTED] wrote: > > >PHP 3.0.18 stops working after i add over 125 virtual hosts in my > >httpd.conf file. PHP 4.0.6 still working. > > > >After reaching this limit PHP3 completely stopps delivering pages. > >Searching the archives i recognized, that nearly the same problem was > >reported on http://bugs.php.net, reading Bug Id #5316 and #6842. > > > >Im running Apache 1.3.20 with PHP 4.0.6 and PHP 3.0.18 > >on Solaris 2.7 > >Unfortunatly i can´t stop serving PHP3 at this moment, so i really need > >for a solution to break through this PHP3 limitation. In addition it > >seems, that PHP4 (at laest after the 4.0.3pl1 release) hasn´t the > >problem or has a higher limit level. > > > > > >Question 1: > >Any chance to configure/patch PHP3 to support more than 255 file > >handles? (equal to "support more than 125 virtual servers" in my > >production environment)? > > > >Question 2: > >Is the problem reported in the two bug reports above solved in PHP > >4.0.6? Or is it pushed to a later appearance by optimising file handle > >consumption? > > > > > >Any one out there who knows more about this? Any hints? > >Thanks in advance. > > > >--Buchholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How to increase number of supported servers?
PHP 3.0.18 stops working after i add over 125 virtual hosts in my httpd.conf file. PHP 4.0.6 still working. After reaching this limit PHP3 completele stopps delivering pages. Searching the archives i recognized, that nearly the same problem was reported on http://bugs.php.net, reading Bug Id #5316 and #6842. Im running Apache 1.3.20 with PHP 4.0.6 and PHP 3.0.18 on Solaris 2.7 Unforenatly i can´t stop serving PHP3 at this moment, so i really need for a solution to break through this PHP3 limitation. In addition it seems, that PHP4 (at laest after the 4.0.3pl1 release) hasn´t the problem or has a higher limit level. Question 1: Any chance to configure/patch PHP3 to support more than 255 file handles? (equal to "support more than 125 virtual servers" in my production environment)? Question 2: Is the problem reported in the two bug reports above solved in PHP 4.0.6? Or is it pushed to a later appearance by optimising file handle consumption? Any one out there who knows more about this? Any hints? Thanks in advance. --Buchholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]