Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7662895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:55:06+00:00 2026-05-31T13:55:06+00:00

When all values are boolean doesn’t the binary & operate on more bits than

  • 0

When all values are boolean doesn’t the binary & operate on more bits than the logical &&?

For example

if ( foo == "Yes" & 2 != 0 & 6 )

or

if ( foo == "Yes" && 2 != 0 && 6 )

(thinking PHP specifically, but any language will do)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:55:07+00:00Added an answer on May 31, 2026 at 1:55 pm

    How many bits it operates on is irrelevant: the processor can do it in a single instruction anyway (normally). The crucial difference is the shortcut-ability of &&, so for anything on the right hand side that’s not trivial to evaluate it is faster — assuming a language where && works this way, like C or Java. (And apparently PHP, though I know to little about it to be sure.)

    On the other hand, the branch that this shortcut requires might also slow down things, however I’m quite sure nowadays’ compilers are smart enough to optimize that away.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given a matrix of boolean values (example): a b c +-------- X | 1
I want to get all values of a set interface in one go as
First i gave all values of row in JTAble. While inserting table values into
I want to get all values of 'id' attribute of 'span' tag with html
In C# i need to get all values of a particular property from an
In PHP how can I quickly tell if all values in array are identical?
I have a DataGridView that I would like all values on a specific row
In C#, is it possible to get all values of a particular column from
I have an array of values all well within the range 0 - 63,
A fellow developer changed all the values in the userid column of table map

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.