{"id":444,"date":"2025-06-10T20:32:22","date_gmt":"2025-06-10T12:32:22","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/php\/php-application-manual\/jcyy\/444.html"},"modified":"2025-06-10T20:32:22","modified_gmt":"2025-06-10T12:32:22","slug":"php-%e6%af%94%e8%be%83%e8%bf%90%e7%ae%97%e7%ac%a6%ef%bc%9a%e5%85%a8%e9%9d%a2%e6%8c%87%e5%8d%97","status":"publish","type":"my1js","link":"https:\/\/www.zhaozhao123.cn\/php\/my1js\/444.html","title":{"rendered":"PHP \u6bd4\u8f83\u8fd0\u7b97\u7b26\uff1a\u5168\u9762\u6307\u5357"},"content":{"rendered":"<p><body><\/p>\n<h2>&#27010;&#36848;<\/h2>\n<p>&#27604;&#36739;&#36816;&#31639;&#31526;&#22312;PHP&#20013;&#38750;&#24120;&#22522;&#30784;&#65292;&#20351;&#24320;&#21457;&#20154;&#21592;&#33021;&#22815;&#36890;&#36807;&#27604;&#36739;&#21464;&#37327;&#26469;&#20570;&#20986;&#20915;&#31574;&#12290;&#26412;&#25351;&#21335;&#35752;&#35770;&#20102;&#36825;&#20123;&#25805;&#20316;&#31526;&#30340;&#22797;&#26434;&#24615;&#21450;&#20854;&#23454;&#38469;&#31034;&#20363;&#12290;<\/p>\n<h2>&#24179;&#31561;&#21644;&#36523;&#20221;<\/h2>\n<p>&#22312;PHP&#20013;&#65292;<code>==<\/code>&#26816;&#26597;&#20004;&#20010;&#20540;&#26159;&#21542;&#30456;&#31561;&#65292;&#21516;&#26102;<code>===<\/code>&#26816;&#26597;&#23427;&#20204;&#26159;&#21542;&#20540;&#30456;&#31561;&#19988;&#31867;&#22411;&#30456;&#21516;&#12290;&#20363;&#22914;&#65306;<\/p>\n<pre><code>$x = 5;\n$y = '5';\nvar_dump($x == $y);  \/\/ bool(true)\nvar_dump($x === $y); \/\/ bool(false)\n<\/code><\/pre>\n<p>&#36825;&#34920;&#26126;&#23613;&#31649;<code>$x<\/code>and &#26159;&ldquo;&#21644;&rdquo;&#30340;&#24847;&#24605;&#65292;&#29992;&#20110;&#36830;&#25509;&#20004;&#20010;&#35789;&#25110;&#30701;&#35821;&#12290;<code>$y<\/code>&#23427;&#20204;&#22312;&#20215;&#20540;&#19978;&#26159;&#30456;&#31561;&#30340;&#65292;&#20294;&#24182;&#19981;&#23436;&#20840;&#30456;&#21516;&#65292;&#22240;&#20026;&#19968;&#20010;&#26159;&#23383;&#31526;&#20018;&#65292;&#21478;&#19968;&#20010;&#26159;&#25972;&#25968;&#12290;<\/p>\n<h2>&#19981;&#24179;&#31561;&#19982;&#38750;&#36523;&#20221;<\/h2>\n<p>&#31867;&#20284;&#20110;&#24179;&#31561;&#12290;<code>!=<\/code>&#21734;&#65292;&#26159;&#30340;&#12290;<code>&lt;&gt;<\/code>&#23545;&#19981;&#24179;&#31561;&#36827;&#34892;&#26816;&#26597;&#12290;<code>!==<\/code>&#26816;&#26597;&#36523;&#20221;&#12290;&#36825;&#26159;&#23427;&#20204;&#26159;&#22914;&#20309;&#24037;&#20316;&#30340;&#65306;<\/p>\n<pre><code>$x = 10;\n$y = '10';\nvar_dump($x != $y);  \/\/ bool(false)\nvar_dump($x !== $y); \/\/ bool(true)\n<\/code><\/pre>\n<h2>&#22823;&#20110;&#21644;&#23567;&#20110;<\/h2>\n<p>&#36816;&#33829;&#21830;<code>&gt;<\/code>and &#26159;&ldquo;&#24182;&#19988;&rdquo;&#30340;&#24847;&#24605;&#12290;<code>&lt;<\/code>&#37117;&#26159;&#30452;&#25130;&#20102;&#24403;&#30340;&#65307;&#23427;&#20204;&#27604;&#36739;&#25968;&#23383;&#65306;<\/p>\n<pre><code>$x = 5;\n$y = 10;\nvar_dump($x &lt; $y);   \/\/ bool(true)\nvar_dump($x &gt; $y);   \/\/ bool(false)\n<\/code><\/pre>\n<h2>&#32852;&#21512;&#36816;&#33829;&#21830;<\/h2>\n<p>PHP 7 &#24341;&#20837;&#20102;&#31661;&#22836;&#36816;&#31639;&#31526;&#12290;<code>&lt;=&gt;<\/code>&#36825;&#20010;&#20989;&#25968;&#36820;&#22238;0&#22914;&#26524;&#24038;&#21491;&#20004;&#36793;&#30340;&#20540;&#30456;&#31561;&#65292;&#36820;&#22238;&#36127;&#25968;&#22914;&#26524;&#24038;&#36793;&#23567;&#20110;&#21491;&#36793;&#65292;&#25110;&#32773;&#36820;&#22238;&#27491;&#25968;&#22914;&#26524;&#24038;&#36793;&#22823;&#20110;&#21491;&#36793;&#12290;&#36825;&#37324;&#26159;&#22914;&#20309;&#20351;&#29992;&#30340;&#65306;<\/p>\n<pre><code>$x = 5;\n$y = 5;\nvar_dump($x &lt;=&gt; $y);  \/\/ int(0)\n$x = 2;\n$y = 5;\nvar_dump($x &lt;=&gt; $y);  \/\/ int(-3)\n$x = 10;\n$y = 5;\nvar_dump($x &lt;=&gt; $y);  \/\/ int(1)\n<\/code><\/pre>\n<h2>&#30495;&#29702;&#20215;&#20540;&#27979;&#35797;<\/h2>\n<p>PHP&#30340;&#26494;&#25955;&#31867;&#22411;&#31995;&#32479;&#24847;&#21619;&#30528;<code>==<\/code>&#23427;&#21487;&#20197;&#20135;&#29983;&#20196;&#20154;&#24778;&#35766;&#30340;&#32467;&#26524;&#65306;<\/p>\n<pre><code>$x = 0;\n$y = 'hello';\nvar_dump($x == $y);  \/\/ bool(false) \n<\/code><\/pre>\n<h2>&#24378;&#21046;&#24615;&#19988;&#20005;&#26684;&#30340;&#31867;&#22411;&#22768;&#26126;&#19982;&#22768;&#26126;<\/h2>\n<p>&#20174;PHP 7&#24320;&#22987;&#65292;&#20320;&#21487;&#20197;&#24378;&#21046;&#20351;&#29992;&#20005;&#26684;&#31867;&#22411;&#22768;&#26126;&#20197;&#36991;&#20813;&#24847;&#22806;&#30340;&#31867;&#22411;&#36716;&#25442;&#65306;<\/p>\n<pre><code>declare(strict_types=1);\n\nfunction add(int $a, int $b): int {\n return $a + $b;\n}\n\nvar_dump(add(2, '3'));  \/\/ TypeError\n<\/code><\/pre>\n<h2>&#30495;&#23454;&#19990;&#30028;&#31034;&#20363;&#65306;&#29992;&#25143;&#36523;&#20221;&#39564;&#35777;<\/h2>\n<p>&#27604;&#36739;&#36816;&#31639;&#31526;&#22312;&#29992;&#25143;&#35748;&#35777;&#31561;&#19978;&#19979;&#25991;&#20013;&#21464;&#24471;&#38750;&#24120;&#24378;&#22823;&#12290;&#36825;&#37324;&#26159;&#19968;&#20010;&#22522;&#26412;&#31034;&#20363;&#65306;<\/p>\n<pre><code>function authenticateUser($username, $password) {\n  \/\/ User retrieval logic...\n  if ($retrievedPassword === $password) {\n    return true;\n  }\n  return false;\n}<\/code><\/pre>\n<h2>&#32467;&#35770;&#12290;<\/h2>\n<p>&#32508;&#19978;&#25152;&#36848;&#65292;PHP&#25552;&#20379;&#20102;&#20174;&#22522;&#26412;&#21040;&#22797;&#26434;&#30340;&#21508;&#31181;&#27604;&#36739;&#36816;&#31639;&#31526;&#65292;&#36825;&#20123;&#24037;&#20855;&#23545;&#20110;&#22312;&#24212;&#29992;&#31243;&#24207;&#20013;&#20934;&#30830;&#35780;&#20272;&#20540;&#38750;&#24120;&#26377;&#29992;&#12290;&#27491;&#30830;&#20351;&#29992;&#23427;&#20204;&#26159;&#32534;&#20889;&#31283;&#20581;PHP&#20195;&#30721;&#30340;&#20851;&#38190;&#12290;<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#27010;&#36848; &#27604;&#36739;&#36816;&#31639;&#31526;&#22312;PHP&#20013;&#38750;&#24120;&#22522;&#30784;&#65292;&#20351;&#24320;&#21457;&#20154;&#21592;&#038;#33..<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false},"tags":[],"my1js2nav":[38],"tuisongtax":[],"class_list":["post-444","my1js","type-my1js","status-publish","hentry","my1js2nav-jcyy"],"acf":{"qian_art_seotitle":"","qian_art_seotitle_source":{"label":"SEO\u6807\u9898","type":"text","formatted_value":""},"qian_art_seokws":"","qian_art_seokws_source":{"label":"SEO\u5173\u952e\u8bcd","type":"text","formatted_value":""},"qian_art_stzhong":"","qian_art_stzhong_source":{"label":"\u4e2d | \u77ed\u6807\u9898","type":"text","formatted_value":""}},"_links":{"self":[{"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/my1js\/444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/my1js"}],"about":[{"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/types\/my1js"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/users\/1"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/media?parent=444"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/tags?post=444"},{"taxonomy":"my1js2nav","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/my1js2nav?post=444"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/tuisongtax?post=444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}