--- id: php-comments title: "PHP Comments" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["PHP 주석"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.88 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["php", "programming", "w3schools", "comments"] raw_sources: ["https://www.w3schools.com/php/php_comments.asp"] applied_in: [] github_commit: "" --- # [[PHP Comments]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) PHP uniquely supports TWO single-line comment styles (`//` and `#`) where most languages offer just one β€” both are fully interchangeable and equally legal, a flexibility inherited from PHP's C-style (`//`) and shell-script-style (`#`) heritage. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Single-line comments** β€” `//` or `#`; everything to end-of-line is ignored. [S1] - **Multi-line comments** β€” `/* ... */`. [S1] - **Purposes** β€” explain code to others, remind yourself later, temporarily disable code for testing. [S1] - **Ignoring code via comments** β€” commenting out a line prevents its execution. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Two single-line styles: `// This is a single-line comment` and `# This is also a single-line comment`. [S1] - Comment before code: `// Output welcome message echo 'Welcome Home!';`. [S1] - Comment at line end: `echo 'Welcome Home!'; // Output welcome message`. [S1] - Disabling code: `// echo 'Welcome Home!';` β€” the echo never runs. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) μ†ŒμŠ€μ—μ„œ λͺ¨μˆœλ˜λŠ” μ •λ³΄λŠ” λ°œκ²¬λ˜μ§€ μ•ŠμŒ. ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” ν…ŒμŠ€νŠΈ 쀑 νŠΉμ • μ½”λ“œ 쀄을 λΉ„ν™œμ„±ν™”ν•˜λŠ” μš©λ„λ‘œ 주석이 자주 쓰인닀. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Two equivalent single-line comment styles (PHP): ```php // This is a single-line comment # This is also a single-line comment ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.88 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[PHP Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[PHP Syntax]], [[PHP Comments Multiline]] - **μ°Έμ‘° λ§₯락:** ν•œ 쀄 주석 문법 β€” μ—¬λŸ¬ 쀄 주석(Multiline) μ±•ν„°λ‘œ 직접 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” PHP Comments β€” https://www.w3schools.com/php/php_comments.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "PHP Comments" page (Astra wiki-curation, P-Reinforce v3.1 format).