Skip to content

Commit

Permalink
var sync with EN
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Jan 27, 2025
1 parent fd0cdb2 commit 7ff7924
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
37 changes: 34 additions & 3 deletions reference/var/functions/empty.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: 4a07033f7ac5ab121357051cc94ec48b9f6f58fc Maintainer: yannick Status: ready -->
<!-- EN-Revision: e6e9c116083c3d1aeb3d1fc2e45f51fbcb0d5182 Maintainer: yannick Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="function.empty" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand Down Expand Up @@ -36,6 +36,7 @@
Aucune alerte n'est générée si la variable n'existe pas. Cela signifie que
<function>empty</function> est strictement équivalent à
<command>!isset($var) || $var == false</command>.
Cela s'applique également aux structures imbriquées, telles qu'un tableau multidimensionnel ou des propriétés chaînées.
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -88,7 +89,6 @@ $expected_array_got_string = 'somestring';
var_dump(empty($expected_array_got_string['some_key']));
var_dump(empty($expected_array_got_string[0]));
var_dump(empty($expected_array_got_string['0']));
var_dump(empty($expected_array_got_string[0.5]));
var_dump(empty($expected_array_got_string['0.5']));
var_dump(empty($expected_array_got_string['0 Mostel']));
?>
Expand All @@ -100,9 +100,40 @@ var_dump(empty($expected_array_got_string['0 Mostel']));
bool(true)
bool(false)
bool(false)
bool(false)
bool(true)
bool(true)
]]>
</screen>
</example>
<example>
<title><function>empty</function> sur les tableaux multidimensionnels</title>
<programlisting role="php">
<![CDATA[
<?php
$multidimensional = [
'some' => [
'deep' => [
'nested' => 'value'
]
]
];
if (!empty($multidimensional['some']['some']['nested'])) {
$someVariable = $multidimensional['some']['deep']['nested'];
}
var_dump(empty($multidimensional['some-undefined-key']));
var_dump(empty($multidimensional['some']['deep']['unknown']));
var_dump(empty($multidimensional['some']['deep']['nested']));
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(true)
bool(true)
bool(false)
]]>
</screen>
</example>
Expand Down
4 changes: 2 additions & 2 deletions reference/var/functions/unserialize.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: d75036c386e37ce56dafb7607b72aedc3e33fe09 Maintainer: yannick Status: ready -->
<!-- EN-Revision: 7cbeceebeff691a1da4d827737622dcb98131176 Maintainer: yannick Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.unserialize" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand Down Expand Up @@ -91,7 +91,7 @@
<tbody>
<row>
<entry><literal>allowed_classes</literal></entry>
<entry><type>array|bool</type></entry>
<entry><type class="union"><type>array</type><type>bool</type></type></entry>
<entry>
<simpara>
Soit un tableau de noms de classes qui doivent être acceptées, &false;
Expand Down

0 comments on commit 7ff7924

Please sign in to comment.