<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki.sehanka.de/index.php?action=history&amp;feed=atom&amp;title=Switch_Statement_%28PHP%29</id>
	<title>Switch Statement (PHP) - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sehanka.de/index.php?action=history&amp;feed=atom&amp;title=Switch_Statement_%28PHP%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.sehanka.de/index.php?title=Switch_Statement_(PHP)&amp;action=history"/>
	<updated>2026-04-25T09:53:00Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in wiki.sehanka.de</subtitle>
	<generator>MediaWiki 1.36.0</generator>
	<entry>
		<id>https://wiki.sehanka.de/index.php?title=Switch_Statement_(PHP)&amp;diff=122&amp;oldid=prev</id>
		<title>Sebastian.kalms am 12. September 2021 um 10:21 Uhr</title>
		<link rel="alternate" type="text/html" href="https://wiki.sehanka.de/index.php?title=Switch_Statement_(PHP)&amp;diff=122&amp;oldid=prev"/>
		<updated>2021-09-12T10:21:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 12. September 2021, 10:21 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l57&quot;&gt;Zeile 57:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 57:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie:Backend-Entwicklung]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie:Backend-Entwicklung]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie:PHP]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie:PHP]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Kategorie:Kontrollstrukturen (PHP)]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sebastian.kalms</name></author>
	</entry>
	<entry>
		<id>https://wiki.sehanka.de/index.php?title=Switch_Statement_(PHP)&amp;diff=119&amp;oldid=prev</id>
		<title>Sebastian.kalms: Die Seite wurde neu angelegt: „ = Verwendung =  We often want to compare a value, expression, or variable against many different possible values and run different code depending on which it…“</title>
		<link rel="alternate" type="text/html" href="https://wiki.sehanka.de/index.php?title=Switch_Statement_(PHP)&amp;diff=119&amp;oldid=prev"/>
		<updated>2021-09-12T10:09:02Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „ = Verwendung =  We often want to compare a value, expression, or variable against many different possible values and run different code depending on which it…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
= Verwendung =&lt;br /&gt;
&lt;br /&gt;
We often want to compare a value, expression, or variable against many different possible values and run different code depending on which it matches. We can use a series of if/elseif statements which use the identical operator (===) or we can use a switch statement—an alternate syntax.&lt;br /&gt;
&lt;br /&gt;
= Code Snippet =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
switch ($variable){&lt;br /&gt;
  case &amp;quot;A&amp;quot;:&lt;br /&gt;
    echo &amp;quot;Terrific&amp;quot;;&lt;br /&gt;
    break;&lt;br /&gt;
  case &amp;quot;B&amp;quot;:&lt;br /&gt;
    echo &amp;quot;Good&amp;quot;;&lt;br /&gt;
    break;&lt;br /&gt;
  case &amp;quot;C&amp;quot;:&lt;br /&gt;
    echo &amp;quot;Fair&amp;quot;;&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    echo &amp;quot;Invalid grade&amp;quot;; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
&lt;br /&gt;
== Bewertung Hausarbeit ==&lt;br /&gt;
&lt;br /&gt;
We wrote some code with a switch statement to print a string based on a student’s letter grade:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
switch ($letter_grade){&lt;br /&gt;
  case &amp;quot;A&amp;quot;:&lt;br /&gt;
    echo &amp;quot;Terrific&amp;quot;;&lt;br /&gt;
    break;&lt;br /&gt;
  case &amp;quot;B&amp;quot;:&lt;br /&gt;
    echo &amp;quot;Good&amp;quot;;&lt;br /&gt;
    break;&lt;br /&gt;
  case &amp;quot;C&amp;quot;:&lt;br /&gt;
    echo &amp;quot;Fair&amp;quot;;&lt;br /&gt;
    break;&lt;br /&gt;
  case &amp;quot;D&amp;quot;:&lt;br /&gt;
    echo &amp;quot;Needs Improvement&amp;quot;;&lt;br /&gt;
    break;&lt;br /&gt;
  case &amp;quot;F&amp;quot;:&lt;br /&gt;
    echo &amp;quot;See me!&amp;quot;;&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    echo &amp;quot;Invalid grade&amp;quot;; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We begin the keyword switch followed by the value (or expression) we’ll be comparing—in this case, $letter_grade. We provide possible matches for the expression with the keyword case, the potential matching value, and the colon. For each case, we provide code that should run if that case matches. After each case, we include the keyword break to break out of the switch statement. We can provide a default that should run if none of the provided cases match.&lt;br /&gt;
&lt;br /&gt;
A switch statement is a good example of code that might be preferable not because it’s shorter, but rather because it clearly indicates the purpose of the code; when looking at a switch statement we can quickly identify the important aspects of the code; this makes it easier to understand, extend, and debug.&lt;br /&gt;
&lt;br /&gt;
[[Kategorie:Web-Entwicklung]]&lt;br /&gt;
[[Kategorie:Backend-Entwicklung]]&lt;br /&gt;
[[Kategorie:PHP]]&lt;/div&gt;</summary>
		<author><name>Sebastian.kalms</name></author>
	</entry>
</feed>