{"id":1869,"date":"2024-04-25T19:48:46","date_gmt":"2024-04-25T11:48:46","guid":{"rendered":"https:\/\/wp.minicoda.com\/?p=1869"},"modified":"2025-03-05T12:49:13","modified_gmt":"2025-03-05T04:49:13","slug":"%e5%ae%9a%e4%b9%89%e5%b8%b8%e9%87%8f%e5%92%8c%e5%8f%98%e9%87%8f%e7%9a%84%e4%b8%8d%e5%90%8c%e5%bd%a2%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/wp.minicoda.com\/index.php\/%e5%ae%9a%e4%b9%89%e5%b8%b8%e9%87%8f%e5%92%8c%e5%8f%98%e9%87%8f%e7%9a%84%e4%b8%8d%e5%90%8c%e5%bd%a2%e5%bc%8f\/","title":{"rendered":"\u5b9a\u4e49\u5e38\u91cf\u548c\u53d8\u91cf\u7684\u4e0d\u540c\u5f62\u5f0f"},"content":{"rendered":"\n<ul class=\"wp-block-list\">\n<li>C\/C++\/ObjC\/C#\/JS\/Go \u9ed8\u8ba4\u58f0\u660e\u7684\u662f\u53d8\u91cf\uff0cconst\u5173\u952e\u5b57\u53d8\u6210\u5e38\u91cf\u662f\u5927\u90e8\u5206\u7f16\u7a0b\u8bed\u8a00\u7684\u9996\u9009\u3002<\/li>\n\n\n\n<li>Swift\/\u4ed3\u9889 \u7528let\u58f0\u660e\u5e38\u91cf\uff0cvar\u58f0\u660e\u53d8\u91cf\u3002<\/li>\n\n\n\n<li>Rust\u66f4\u52a0\u4e25\u683c\uff0c\u9ed8\u8ba4\u7528let\u7ed1\u5b9a\u5c31\u662f\u5e38\u91cf\uff0c\u7528mut\u4fee\u9970\u624d\u662f\u53d8\u91cf\u3002<\/li>\n\n\n\n<li>VB\u5e38\u91cf\u7528Const.<\/li>\n\n\n\n<li>Python\u6ca1\u6709\u4ee3\u8868\u5e38\u91cf\u7684\u5173\u952e\u5b57\uff0c\u53d6\u51b3\u4e8e\u7ea6\u5b9a\uff0c\u4e00\u822c\u7ea6\u5b9a\u5927\u5199\u4e3a\u5e38\u91cf\u3002<\/li>\n\n\n\n<li>Java\u7528final\u4ee3\u8868\u5e38\u91cf\u3002<\/li>\n\n\n\n<li>JS ES6\u4e4b\u524dvar\u4ee3\u8868\u53d8\u91cf\uff0cES6\u4e4b\u540e\u5f3a\u70c8\u63a8\u8350\u7528let\u4ee3\u66ff\u53d8\u91cf\uff0c\u53ef\u4ee5\u89e3\u51b3var\u4f1a\u6c61\u67d3\u4f5c\u7528\u57df\u7684\u95ee\u9898\u3002<\/li>\n\n\n\n<li>Pascal\u7528Const\u6216\u8005const\u4ee3\u8868\u5e38\u91cf\uff0c\u4e0d\u8fc7\u5b83\u4e0d\u9700\u8981\u6307\u5b9a\u7c7b\u578b\u3002\u4f8b\u5982\uff1a<br>Const A = 100;<br>Pascal\u8fd8\u652f\u6301\u591a\u4e2aConst\u653e\u5728\u4e00\u8d77\u5b9a\u4e49\uff0c\u4f8b\u5982\uff1a<br>Const c1 = 'a';<br>c2 = 'b';<br>\u5982\u4e0a\uff0cc1\u548cc2\u90fd\u662f\u5e38\u91cf\u3002<\/li>\n\n\n\n<li>PHP \u5b9a\u4e49\u5e38\u91cf\u7684\u65b9\u5f0f\u6709\u4e24\u79cd\uff0c\u4e00\u79cd\u662fconst\uff0c\u4e00\u79cd\u662f\uff1adefine(<strong><em>identifier<\/em><\/strong>, <strong><em>value<\/em><\/strong>)\uff0cPHP 4\u4e4b\u540e\u5e38\u91cf\u65e0\u9700\u58f0\u660e\uff0c\u6ce8\u610f\u53d8\u91cf\u9700\u8981\u4ee5$\u5f00\u5934\u800c\u5e38\u91cf\u65e0\u6b64\u9650\u5236\u3002\n<ul class=\"wp-block-list\">\n<li>\u4f8b\u5982\uff1adefine(\"NUM\", 2) \u5b9a\u4e49\u5e38\u91cfNUM\uff0c\u503c\u662f2.<\/li>\n\n\n\n<li>constant(\"NUM\") \u83b7\u53d6\u5e38\u91cfNUM\u7684\u6570\u503c\uff0cdefined(\"NUM\")\u8fd4\u56de1\uff0c\u4ee3\u8868\u5e38\u91cfNUM\u6709\u5b9a\u4e49\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Kotlin \u7528var\u4ee3\u8868\u53d8\u91cf\uff0cval\u4ee3\u8868\u5e38\u91cf\u3002\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0cval\u53ef\u6307\u4ee3\u4e0d\u53ef\u53d8\u5f15\u7528\uff0c\u5373\u6b64\u5f15\u7528\u4e0d\u53ef\u4ee5\u88ab\u8d4b\u503c\u4e3a\u65b0\u503c\uff0c\u4f46\u6b64\u5bf9\u8c61\u5185\u90e8\u7684\u72b6\u6001\u53ef\u4ee5\u6539\u53d8\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u9884\u5b9a\u4e49\u5e38\u91cf<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP \u9884\u5b9a\u4e49\u5e38\u91cf\u5305\u542b __FILE__, __LINE__, PHP_VERSION \u7b49\u3002<\/li>\n\n\n\n<li>VB\u63d0\u4f9b\u4e86\u4e00\u4e9b\u4ee5vb\u5f00\u5934\u7684\u7cfb\u7edf\u5e38\u91cf\uff0c\u4f8b\u5982vbCrLf\u8868\u793a\u56de\u8f66\u6362\u884c\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u9884\u5b9a\u4e49\u53d8\u91cf<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP \u4e3a\u4e86\u66f4\u597d\u652f\u6301\u7f51\u7edc\u6570\u636e\u5305\uff0c\u6709\u4e00\u4e9b\u9884\u5b9a\u4e49\u5e38\u91cf\uff0c\u4f8b\u5982 $_GET, $_POST, $_GLOBALS\u7b49\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u53ef\u53d8\u53d8\u91cf<\/h3>\n\n\n\n<p>  \u8fd9\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u53d8\u91cf\uff0c\u53d8\u91cf\u7684\u540d\u79f0\u662f\u53e6\u4e00\u4e2a\u53d8\u91cf\u7684\u503c\u5f97\u6765\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP \u7528$\u6765\u652f\u6301\u53ef\u53d8\u53d8\u91cf\uff0c\u4f8b\u5982\uff1a<br>$a = \"bcd\"<br>$bcd = \"this is bcd\"<br>echo $$a               \/\/ \u8f93\u51fa this is bcd<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u9884\u5b9a\u4e49\u5e38\u91cf \u9884\u5b9a\u4e49\u53d8\u91cf \u53ef\u53d8\u53d8\u91cf \u8fd9\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u53d8\u91cf\uff0c\u53d8\u91cf\u7684\u540d\u79f0\u662f\u53e6\u4e00\u4e2a\u53d8\u91cf\u7684\u503c\u5f97\u6765\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[299],"tags":[],"class_list":["post-1869","post","type-post","status-publish","format-standard","hentry","category-think"],"views":83,"_links":{"self":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/1869","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/comments?post=1869"}],"version-history":[{"count":16,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/1869\/revisions"}],"predecessor-version":[{"id":3881,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/1869\/revisions\/3881"}],"wp:attachment":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/media?parent=1869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/categories?post=1869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/tags?post=1869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}