--- id: php-looping-break title: "PHP Looping Break" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["break statement", "PHP break"] 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", "loops", "break"] raw_sources: ["https://www.w3schools.com/php/php_looping_break.asp"] applied_in: [] github_commit: "" --- # [[PHP Looping Break]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) `break` works identically across ALL four PHP loop types (for, while, do-while, foreach) β€” this chapter's entire purpose is to demonstrate that one keyword's behavior (immediately end the entire loop) generalizes uniformly regardless of which loop construct wraps it. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`break`** β€” immediately ends the entire loop's execution, regardless of loop type. [S1] - **Applies uniformly to** β€” for, while, do...while, foreach. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - For: `for ($x = 0; $x < 10; $x++) { if ($x == 4) { break; } echo "The number is: $x
"; }`. [S1] - While: `$x = 0; while($x < 10) { if ($x == 4) { break; } echo "The number is: $x
"; $x++; }`. [S1] - Do-while: `$i = 1; do { if ($i == 3) break; echo $i; $i++; } while ($i < 6);`. [S1] - Foreach: `foreach ($colors as $value) { if ($value == "blue") break; echo "$value
"; }`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) μ†ŒμŠ€μ—μ„œ λͺ¨μˆœλ˜λŠ” μ •λ³΄λŠ” λ°œκ²¬λ˜μ§€ μ•ŠμŒ. ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” 4κ°€μ§€ 반볡문 λͺ¨λ‘μ—μ„œ λ™μΌν•˜κ²Œ λ™μž‘ν•˜λŠ” break의 λ²”μš©μ„±μ΄ 핡심이닀. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) break behaves identically across loop types (PHP): ```php for ($x = 0; $x < 10; $x++) { if ($x == 4) { break; } echo "The number is: $x
"; } ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.88 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[PHP Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[PHP Looping Foreach]], [[PHP Looping Continue]], [[PHP Functions]] - **μ°Έμ‘° λ§₯락:** λͺ¨λ“  반볡문 κ³΅ν†΅μ˜ break λ™μž‘ β€” continue 챕터와 짝을 이룸. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” PHP Break Statement β€” https://www.w3schools.com/php/php_looping_break.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "PHP Break Statement" page (Astra wiki-curation, P-Reinforce v3.1 format).