{"id":19186,"date":"2026-09-04T22:02:14","date_gmt":"2026-09-04T12:02:14","guid":{"rendered":"https:\/\/geoffreychen.com\/namespaces-let-the-same-name-exist-in-different-scopes\/"},"modified":"2026-09-04T22:02:14","modified_gmt":"2026-09-04T12:02:14","slug":"namespaces-let-the-same-name-exist-in-different-scopes","status":"publish","type":"post","link":"https:\/\/geoffreychen.com\/zh\/namespaces-let-the-same-name-exist-in-different-scopes\/","title":{"rendered":"\u547d\u540d\u7a7a\u95f4\uff1a\u540c\u540d\u4e3a\u4ec0\u4e48\u4e0d\u4e00\u5b9a\u51b2\u7a81\uff1f"},"content":{"rendered":"<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/public-assets.geoffreychen.com\/wordpress\/articles\/namespaces-let-the-same-name-exist-in-different-scopes\/99752a0ec102d4b06ae62393.jpg?w=1140&#038;ssl=1\" alt=\"\u547d\u540d\u7a7a\u95f4\uff1a\u540c\u540d\u4e3a\u4ec0\u4e48\u4e0d\u4e00\u5b9a\u51b2\u7a81\uff1f\" loading=\"lazy\"><\/p>\n<p>\u547d\u540d\u7a7a\u95f4\u628a\u540d\u79f0\u653e\u8fdb\u4e00\u4e2a\u660e\u786e\u8303\u56f4\uff0c\u4f7f\u76f8\u540c\u540d\u5b57\u53ef\u4ee5\u5206\u522b\u6307\u5411\u4e0d\u540c\u5bf9\u8c61\u3002\u7535\u8111\u91cc\u4e24\u4e2a\u6587\u4ef6\u90fd\u53eb notes.txt\uff0c\u53ea\u8981\u4f4d\u4e8e\u4e0d\u540c\u6587\u4ef6\u5939\uff0c\u5c31\u4e0d\u5fc5\u51b2\u7a81\uff1b\u5b8c\u6574\u6307\u5411\u5b83\u4eec\u7684\u4e0d\u662f\u6587\u4ef6\u540d\u672c\u8eab\uff0c\u800c\u662f\u6587\u4ef6\u5939\u8def\u5f84\u52a0\u6587\u4ef6\u540d\u3002<\/p>\n<p>\u5b83\u4e0d\u540c\u4e8e\u522b\u540d\u3002\u522b\u540d\u662f\u591a\u4e2a\u540d\u5b57\u6307\u5411\u540c\u4e00\u5bf9\u8c61\uff1b\u547d\u540d\u7a7a\u95f4\u5219\u5141\u8bb8\u540c\u4e00\u4e2a\u540d\u5b57\u5728\u4e0d\u540c\u8303\u56f4\u5185\u6307\u5411\u4e0d\u540c\u5bf9\u8c61\u3002\u5b83\u4e5f\u4e0d\u7b49\u4e8e\u5206\u7c7b\uff1a\u5206\u7c7b\u56de\u7b54\u5bf9\u8c61\u5c5e\u4e8e\u54ea\u4e00\u7c7b\uff0c\u547d\u540d\u7a7a\u95f4\u9996\u5148\u89e3\u51b3\u540d\u79f0\u600e\u6837\u88ab\u552f\u4e00\u89e3\u6790\u3002<\/p>\n<p>\u547d\u540d\u7a7a\u95f4\u7684\u91cd\u8981\u6027\u5728\u4e8e\uff0c\u5b83\u8ba9\u5c40\u90e8\u547d\u540d\u4fdd\u6301\u7b80\u77ed\uff0c\u540c\u65f6\u907f\u514d\u6574\u4e2a\u7cfb\u7edf\u8981\u6c42\u6bcf\u4e2a\u540d\u5b57\u90fd\u5168\u7403\u552f\u4e00\u3002\u4f46\u8303\u56f4\u5fc5\u987b\u53ef\u8fa8\u8ba4\uff0c\u89e3\u6790\u89c4\u5219\u4e5f\u5fc5\u987b\u7a33\u5b9a\uff1b\u4e00\u65e6\u53ea\u628a notes.txt \u8131\u79bb\u8def\u5f84\u4f20\u7ed9\u522b\u4eba\uff0c\u539f\u672c\u88ab\u7a7a\u95f4\u9694\u5f00\u7684\u6b67\u4e49\u5c31\u4f1a\u91cd\u65b0\u51fa\u73b0\u3002\u771f\u6b63\u51b3\u5b9a\u51b2\u7a81\u7684\uff0c\u4e0d\u53ea\u662f\u4e24\u4e2a\u8bcd\u662f\u5426\u76f8\u540c\uff0c\u800c\u662f\u7cfb\u7edf\u5728\u4ec0\u4e48\u8303\u56f4\u5185\u5bfb\u627e\u5b83\u4eec\u3002<\/p>\n<p>","protected":false},"excerpt":{"rendered":"","protected":false},"author":17897162,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_geoff_meta_description_en":"Namespaces place names within explicit scopes, allowing identical labels to refer to different objects without automatically creating a conflict.","_geoff_meta_description_zh":"\u547d\u540d\u7a7a\u95f4\u628a\u540d\u79f0\u653e\u8fdb\u660e\u786e\u8303\u56f4\uff0c\u4f7f\u76f8\u540c\u540d\u5b57\u53ef\u4ee5\u5206\u522b\u6307\u5411\u4e0d\u540c\u5bf9\u8c61\uff1b\u771f\u6b63\u7684\u51b2\u7a81\u53d6\u51b3\u4e8e\u8303\u56f4\u3001\u4e0a\u4e0b\u6587\u548c\u7a33\u5b9a\u7684\u89e3\u6790\u89c4\u5219\uff0c\u800c\u4e0d\u53ea\u53d6\u51b3\u4e8e\u5b57\u9762\u662f\u5426\u76f8\u540c\u3002","_wpcom_ai_launchpad_first_post":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[787294141],"tags":[787299348,787299350,787299351,787299349],"class_list":["post-19186","post","type-post","status-publish","format-standard","hentry","category-philosophical-concepts","tag-namespace","tag-naming","tag-naming-zh","tag-namespace-zh",""],"translatepress_titles":{"en_AU":"Namespaces: Why Do Identical Names Not Always Conflict?","zh_CN":"\u547d\u540d\u7a7a\u95f4\uff1a\u540c\u540d\u4e3a\u4ec0\u4e48\u4e0d\u4e00\u5b9a\u51b2\u7a81\uff1f"},"jetpack_publicize_connections":[],"jetpack_likes_enabled":false,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1ar9H-4Zs","jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/geoffreychen.com\/zh\/wp-json\/wp\/v2\/posts\/19186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geoffreychen.com\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geoffreychen.com\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geoffreychen.com\/zh\/wp-json\/wp\/v2\/users\/17897162"}],"replies":[{"embeddable":true,"href":"https:\/\/geoffreychen.com\/zh\/wp-json\/wp\/v2\/comments?post=19186"}],"version-history":[{"count":0,"href":"https:\/\/geoffreychen.com\/zh\/wp-json\/wp\/v2\/posts\/19186\/revisions"}],"wp:attachment":[{"href":"https:\/\/geoffreychen.com\/zh\/wp-json\/wp\/v2\/media?parent=19186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geoffreychen.com\/zh\/wp-json\/wp\/v2\/categories?post=19186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geoffreychen.com\/zh\/wp-json\/wp\/v2\/tags?post=19186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}