Skip to content

Commit

Permalink
language sync with EN (#973)
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen authored May 29, 2024
1 parent c92e13b commit c19fc4b
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion language/control-structures/match.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 78d273c6d4b08d0ee04b69bc3a9230a39b99d60f Maintainer: pierrick Status: ready -->
<!-- EN-Revision: 6c71b05df89358d7760a4740ed3fcfa1682eadb6 Maintainer: pierrick Status: ready -->
<!-- Reviewed: yes -->

<sect1 xml:id="control-structures.match" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
Expand Down Expand Up @@ -56,6 +56,33 @@ string(19) "This food is a cake"
</screen>
</example>

<example>
<title>Exemple d'utilisation de <literal>match</literal> avec des opérateurs de comparaison</title>
<programlisting role="php">
<![CDATA[
<?php
$age = 18;
$output = match (true) {
$age < 2 => "Bébé",
$age < 13 => "Enfant",
$age <= 19 => "Adolescent",
$age > 19 => "Jeune adulte",
$age >= 40 => "Adulte âgé"
};
var_dump($output);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
string(9) "Adolescent"
]]>
</screen>
</example>

<note>
<simpara>
Le résultat d'une expression <literal>match</literal> n'a pas besoin d'être utilisé.
Expand Down

0 comments on commit c19fc4b

Please sign in to comment.