{"id":27492,"date":"2024-11-24T09:29:46","date_gmt":"2024-11-24T01:29:46","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27492\/"},"modified":"2024-11-24T09:29:46","modified_gmt":"2024-11-24T01:29:46","slug":"php%e4%b8%ad%e6%98%af%e4%bb%80%e4%b9%88%e8%bf%90%e7%ae%97%e7%ac%a6","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27492\/","title":{"rendered":"php\u4e2d===\u662f\u4ec0\u4e48\u8fd0\u7b97\u7b26"},"content":{"rendered":"<blockquote><p>\n  php \u4e2d\u7684 === \u8fd0\u7b97\u7b26\u7528\u4e8e\u4e25\u683c\u76f8\u7b49\u6bd4\u8f83\uff0c\u8981\u6c42\u4e24\u4e2a\u8868\u8fbe\u5f0f\u7684\u7c7b\u578b\u548c\u503c\u90fd\u76f8\u540c\u3002\u5b83\u5e38\u7528\u4e8e\u6bd4\u8f83\u5e03\u5c14\u503c\u3001\u6d6e\u70b9\u6570\u548c\u5bf9\u8c61\uff0c\u786e\u4fdd\u7cbe\u786e\u6bd4\u8f83\u5e76\u907f\u514d\u7531\u4e8e\u7c7b\u578b\u4e0d\u5339\u914d\u6216\u6d6e\u70b9\u6570\u4e0d\u7cbe\u786e\u800c\u9020\u6210\u7684\u9519\u8bef\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202411\/11\/2024111100155562595.jpg\" class=\"aligncenter\" title=\"php\u4e2d===\u662f\u4ec0\u4e48\u8fd0\u7b97\u7b26\u63d2\u56fe\" alt=\"php\u4e2d===\u662f\u4ec0\u4e48\u8fd0\u7b97\u7b26\u63d2\u56fe\" \/><\/p>\n<p><strong>php\u4e2d===\u662f\u4ec0\u4e48\u8fd0\u7b97\u7b26\uff1f<\/strong><\/p>\n<p>===\u662fPHP\u4e2d\u4e00\u4e2a\u76f8\u7b49\u6bd4\u8f83\u8fd0\u7b97\u7b26\uff0c\u5b83\u6bd4\u8f83\u4e24\u4e2a\u8868\u8fbe\u5f0f\u7684\u503c\u662f\u5426\u4e25\u683c\u76f8\u7b49\uff0c\u5373\u7c7b\u578b\u548c\u503c\u90fd\u76f8\u540c\u3002<\/p>\n<p><strong>\u4e25\u683c\u76f8\u7b49<\/strong><\/p>\n<p>\u4e0e\u4f20\u7edf\u7684\u76f8\u7b49\u8fd0\u7b97\u7b26\uff08==\uff09\u4e0d\u540c\uff0c===\u8981\u6c42\u6bd4\u8f83\u7684\u53cc\u65b9\u5728\u7c7b\u578b\u548c\u503c\u4e0a\u90fd\u5b8c\u5168\u76f8\u540c\u3002\u8fd9\u610f\u5473\u7740\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li> <strong>\u7c7b\u578b\u5339\u914d\uff1a<\/strong>\u4e24\u4e2a\u8868\u8fbe\u5f0f\u5fc5\u987b\u5177\u6709\u76f8\u540c\u7684\u7c7b\u578b\uff0c\u4f8b\u5982\u5b57\u7b26\u4e32\u3001\u6574\u6570\u6216\u5e03\u5c14\u503c\u3002<\/li>\n<li> <strong>\u503c\u5339\u914d\uff1a<\/strong>\u4e24\u4e2a\u8868\u8fbe\u5f0f\u5fc5\u987b\u5177\u6709\u76f8\u540c\u7684\u503c\u3002<\/li>\n<\/ul>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre>$a = 10;\n$b = '10';\n\nvar_dump($a == $b); \/\/ true\nvar_dump($a === $b); \/\/ false<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u7b2c\u4e00\u4e2a\u793a\u4f8b\u4e2d\uff0c==\u5c0610\u89c6\u4e3a\u6574\u6570\u548c\u5b57\u7b26\u4e32\uff0c\u56e0\u6b64\u8fd4\u56detrue\u3002\u800c\u5728\u7b2c\u4e8c\u4e2a\u793a\u4f8b\u4e2d\uff0c===\u8981\u6c42\u7c7b\u578b\u548c\u503c\u90fd\u76f8\u540c\uff0c\u56e0\u6b64\u8fd4\u56defalse\u3002<\/p>\n<p><strong>\u4f55\u65f6\u4f7f\u7528===\uff1f<\/strong><\/p>\n<p>\u5f53\u9700\u8981\u5bf9\u4e24\u4e2a\u8868\u8fbe\u5f0f\u7684\u7c7b\u578b\u548c\u503c\u8fdb\u884c\u7cbe\u786e\u6bd4\u8f83\u65f6\uff0c\u5e94\u4f7f\u7528===\u8fd0\u7b97\u7b26\u3002\u8fd9\u5728\u4ee5\u4e0b\u60c5\u51b5\u4e0b\u7279\u522b\u6709\u7528\uff1a<\/p>\n<ul>\n<li>\u6bd4\u8f83\u5e03\u5c14\u503c\u65f6\uff0c\u4ee5\u907f\u514d\u5c06true\u548c1\u7b49\u540c\u3002<\/li>\n<li>\u6bd4\u8f83\u6d6e\u70b9\u6570\u65f6\uff0c\u4ee5\u907f\u514d\u7531\u4e8e\u6d6e\u70b9\u6570\u4e0d\u7cbe\u786e\u5bfc\u81f4\u7684\u8bef\u5dee\u3002<\/li>\n<li>\u6bd4\u8f83\u5bf9\u8c61\u65f6\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u5f15\u7528\u7684\u662f\u540c\u4e00\u4e2a\u5bf9\u8c61\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662fphp\u4e2d===\u662f\u4ec0\u4e48\u8fd0\u7b97\u7b26\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>php \u4e2d\u7684 === \u8fd0\u7b97\u7b26\u7528\u4e8e\u4e25\u683c\u76f8\u7b49\u6bd4\u8f83\uff0c\u8981\u6c42\u4e24\u4e2a\u8868\u8fbe\u5f0f\u7684\u7c7b\u578b\u548c\u503c\u90fd\u76f8\u540c\u3002\u5b83\u5e38\u7528\u4e8e\u6bd4\u8f83\u5e03\u5c14\u503c\u3001\u6d6e\u70b9\u6570\u548c\u5bf9\u8c61\uff0c\u786e\u4fdd\u7cbe\u786e\u6bd4\u8f83\u5e76\u907f\u514d\u7531\u4e8e\u7c7b\u578b\u4e0d\u5339\u914d\u6216\u6d6e\u70b9\u6570\u4e0d\u7cbe\u786e\u800c\u9020\u6210\u7684\u9519\u8bef\u3002 php\u4e2d===\u662f\u4ec0\u4e48\u8fd0\u7b97\u7b26\uff1f ===\u662fPHP\u4e2d\u4e00\u4e2a\u76f8\u7b49\u6bd4\u8f83\u8fd0\u7b97\u7b26\uff0c\u5b83\u6bd4\u8f83\u4e24\u4e2a\u8868\u8fbe\u5f0f\u7684\u503c\u662f\u5426\u4e25\u683c\u76f8\u7b49\uff0c\u5373\u7c7b\u578b\u548c\u503c\u90fd\u76f8\u540c\u3002 \u4e25\u683c\u76f8\u7b49 \u4e0e\u4f20\u7edf\u7684\u76f8\u7b49\u8fd0\u7b97\u7b26\uff08==\uff09\u4e0d\u540c\uff0c===\u8981\u6c42\u6bd4\u8f83\u7684\u53cc\u65b9\u5728\u7c7b\u578b\u548c\u503c\u4e0a\u90fd\u5b8c\u5168\u76f8\u540c\u3002\u8fd9\u610f\u5473\u7740\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u7c7b\u578b\u5339\u914d\uff1a\u4e24\u4e2a\u8868\u8fbe\u5f0f\u5fc5\u987b\u5177\u6709\u76f8\u540c\u7684\u7c7b\u578b\uff0c\u4f8b\u5982\u5b57\u7b26\u4e32\u3001\u6574\u6570\u6216\u5e03\u5c14\u503c\u3002 \u503c\u5339\u914d\uff1a\u4e24\u4e2a\u8868\u8fbe\u5f0f\u5fc5\u987b\u5177\u6709\u76f8\u540c\u7684\u503c\u3002 \u793a\u4f8b\uff1a $a = 10; $b = &#8217;10&#8217;; var_dump($a == $b); \/\/ true var_dump($a === $b); \/\/ false \u767b\u5f55\u540e\u590d\u5236 \u5728\u7b2c\u4e00\u4e2a\u793a\u4f8b\u4e2d\uff0c==\u5c0610\u89c6\u4e3a\u6574\u6570\u548c\u5b57\u7b26\u4e32\uff0c\u56e0\u6b64\u8fd4\u56detrue\u3002\u800c\u5728\u7b2c\u4e8c\u4e2a\u793a\u4f8b\u4e2d\uff0c===\u8981\u6c42\u7c7b\u578b\u548c\u503c\u90fd\u76f8\u540c\uff0c\u56e0\u6b64\u8fd4\u56defalse\u3002 \u4f55\u65f6\u4f7f\u7528===\uff1f \u5f53\u9700\u8981\u5bf9\u4e24\u4e2a\u8868\u8fbe\u5f0f\u7684\u7c7b\u578b\u548c\u503c\u8fdb\u884c\u7cbe\u786e\u6bd4\u8f83\u65f6\uff0c\u5e94\u4f7f\u7528===\u8fd0\u7b97\u7b26\u3002\u8fd9\u5728\u4ee5\u4e0b\u60c5\u51b5\u4e0b\u7279\u522b\u6709\u7528\uff1a \u6bd4\u8f83\u5e03\u5c14\u503c\u65f6\uff0c\u4ee5\u907f\u514d\u5c06true\u548c1\u7b49\u540c\u3002 \u6bd4\u8f83\u6d6e\u70b9\u6570\u65f6\uff0c\u4ee5\u907f\u514d\u7531\u4e8e\u6d6e\u70b9\u6570\u4e0d\u7cbe\u786e\u5bfc\u81f4\u7684\u8bef\u5dee\u3002 \u6bd4\u8f83\u5bf9\u8c61\u65f6\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u5f15\u7528\u7684\u662f\u540c\u4e00\u4e2a\u5bf9\u8c61\u3002 \u4ee5\u4e0a\u5c31\u662fphp\u4e2d===\u662f\u4ec0\u4e48\u8fd0\u7b97\u7b26\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-27492","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=27492"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27492\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}