Ask a PHP & operation question

Source: Internet
Author: User
Ask a PHP & operation question, where OS _type is 3 OS _rs ['app _ key'] is 134217728, that is, the 16th 8000000

Echo "#########"."
";
Echo $ OS _type. "". $ OS _rs ['app _ key']."
";
Echo ($ OS _type) & ($ OS _rs ['app _ key']); = "The result is 1.
Echo"
";
Echo (3) & ($ OS _rs ['app _ key']); ===" the result is 0.
Echo"
";
Echo (268435455) & ($ OS _rs ['app _ key']); ===" the result is 134217728.
Echo"
";
Echo $ OS _type & 134217728 ;== the result is 0, which is normal.
Echo"
";

Echo"";
Echo" If ($ flag! = 0)
Echo "checked = \" checked \"";
Echo "> ";
Echo "$ app_str ";
Echo"";
Echo"";


The strange thing is why two variables & the result of the operation is 1, does it involve symbols?


Reply to discussion (solution)

$os_type = 3;$os_rs['app_key'] = 134217728;var_dump( $os_type & $os_rs['app_key'] );
Int (0)

$os_type = 3;$os_rs['app_key'] = 134217728;var_dump( $os_type & $os_rs['app_key'] );
Int (0)

The situation is more responsible than imagined. the assignment results inside {} are different from those outside {}.

Me ??? The row is 0.

Echo ($ OS _type) & ($ OS _rs ['app _ key']); // 0

What are the details?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.