cvs: phpdoc-fr /reference/var/functions gettype.xml import-request-variables.xml is-binary.xml is-buffer.xml is-null.xml is-numeric.xml is-object.xml
is-unicode.xml strval.xml unserialize.xml

From: Date: Wed, 07 Jan 2009 21:04:20 +0000
Subject: cvs: phpdoc-fr /reference/var/functions gettype.xml import-request-variables.xml is-binary.xml is-buffer.xml is-null.xml is-numeric.xml is-object.xml
is-unicode.xml strval.xml unserialize.xml
Groups: php.doc.fr 
Request: Send a blank email to doc-fr+get-6299@lists.php.net to get a copy of this message
dams Wed Jan 7 21:04:20 2009 UTC Modified files: /phpdoc-fr/reference/var/functions gettype.xml import-request-variables.xml is-binary.xml is-buffer.xml is-null.xml is-numeric.xml is-object.xml is-unicode.xml strval.xml unserialize.xml Log: sync with en

http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/var/functions/gettype.xml?r1=1.18&r2=1.19&diff_format=u Index: phpdoc-fr/reference/var/functions/gettype.xml diff -u phpdoc-fr/reference/var/functions/gettype.xml:1.18 phpdoc-fr/reference/var/functions/gettype.xml:1.19 --- phpdoc-fr/reference/var/functions/gettype.xml:1.18 Sat May 31 23:01:18 2008 +++ phpdoc-fr/reference/var/functions/gettype.xml Wed Jan 7 21:04:20 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.18 $ --> -<!-- EN-Revision: 1.11 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.19 $ --> +<!-- EN-Revision: 1.12 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.gettype" xmlns="http://docbook.org/ns/docbook"> @@ -105,6 +105,38 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>gettype</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +$data = array(1, 1., NULL, new stdClass, 'foo'); + +foreach ($data as $value) { + echo gettype($value), "\n"; +} + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +integer +double +NULL +object +string +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/var/functions/import-request-variables.xml?r1=1.16&r2=1.17&diff_format=u Index: phpdoc-fr/reference/var/functions/import-request-variables.xml diff -u phpdoc-fr/reference/var/functions/import-request-variables.xml:1.16 phpdoc-fr/reference/var/functions/import-request-variables.xml:1.17 --- phpdoc-fr/reference/var/functions/import-request-variables.xml:1.16 Sat May 31 23:01:18 2008 +++ phpdoc-fr/reference/var/functions/import-request-variables.xml Wed Jan 7 21:04:20 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.16 $ --> -<!-- EN-Revision: 1.14 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.17 $ --> +<!-- EN-Revision: 1.15 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.import-request-variables" xmlns="http://docbook.org/ns/docbook"> @@ -109,7 +109,7 @@ &reftitle.seealso; <para> <simplelist> - <member><link linkend="reserved.variables.request">$_REQUEST</link></member> + <member><varname>$_REQUEST</varname></member> <member><link linkend="ini.register-globals">register_globals</link></member> <member><link linkend="language.variables.predefined">variables prédéfinies</link></member> <member><function>extract</function></member> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/var/functions/is-binary.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-fr/reference/var/functions/is-binary.xml diff -u phpdoc-fr/reference/var/functions/is-binary.xml:1.3 phpdoc-fr/reference/var/functions/is-binary.xml:1.4 --- phpdoc-fr/reference/var/functions/is-binary.xml:1.3 Sat May 31 23:01:18 2008 +++ phpdoc-fr/reference/var/functions/is-binary.xml Wed Jan 7 21:04:20 2009 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> -<!-- Reviewed: no --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> +<!-- Reviewed: yes --> <refentry xml:id="function.is-binary" xmlns="http://docbook.org/ns/docbook"> <refnamediv> @@ -44,6 +44,37 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>is_binary</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Déclare une chaîne unicode +$unicode = 'Ceci est une chaîne Unicode'; + +// Déclare une chaîne binaire avec le préfixe 'b' +// possible depuis PHP 5.2.1, mais avec des effets +// uniquement à partir de PHP 6.0.0 +$binary = b'Ceci est une chaîne binaire'; + +var_dump(is_binary($unicode), is_binary($binary)); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +bool(false) +bool(true) +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/var/functions/is-buffer.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-fr/reference/var/functions/is-buffer.xml diff -u phpdoc-fr/reference/var/functions/is-buffer.xml:1.3 phpdoc-fr/reference/var/functions/is-buffer.xml:1.4 --- phpdoc-fr/reference/var/functions/is-buffer.xml:1.3 Sat May 31 23:01:18 2008 +++ phpdoc-fr/reference/var/functions/is-buffer.xml Wed Jan 7 21:04:20 2009 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> -<!-- Reviewed: no --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.4 Maintainer: yannick Status: ready --> +<!-- Reviewed: yes --> <refentry xml:id="function.is-buffer" xmlns="http://docbook.org/ns/docbook"> <refnamediv> @@ -44,6 +44,52 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemle avec <function>is_buffer</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Déclare des variables avec différents types +$types = array( + 'unicode' => 'Unicode string', + 'binary' => b'Binary string', + 'resource' => fopen('php://stdin', 'r'), + 'integer' => 42 + ); + +// Teste les types de buffer +foreach($types as $type => $value) +{ + if(is_buffer($value)) + { + echo $type . ' est une chaîne unicode ou binaire'; + } + else + { + echo $type . ' n\'est pas un buffer'; + } + + echo PHP_EOL; +} +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +unicode est une chaîne unicode ou binaire +binary est une chaîne unicode ou binaire +resource n'est pas un buffer +integer n'est pas un buffer +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/var/functions/is-null.xml?r1=1.13&r2=1.14&diff_format=u Index: phpdoc-fr/reference/var/functions/is-null.xml diff -u phpdoc-fr/reference/var/functions/is-null.xml:1.13 phpdoc-fr/reference/var/functions/is-null.xml:1.14 --- phpdoc-fr/reference/var/functions/is-null.xml:1.13 Sat May 31 23:01:18 2008 +++ phpdoc-fr/reference/var/functions/is-null.xml Wed Jan 7 21:04:20 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> -<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.14 $ --> +<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.is-null" xmlns="http://docbook.org/ns/docbook"> @@ -40,6 +40,33 @@ sinon. </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>is_null</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +error_reporting(E_ALL); + +$foo = NULL; +var_dump(is_null($inexistent), is_null($foo)); + +?> +]]> + </programlisting> + <screen> +<![CDATA[ +Notice: Undefined variable: inexistent in ... +bool(true) +bool(true) +]]> + </screen> + </example> + </para> + </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/var/functions/is-numeric.xml?r1=1.13&r2=1.14&diff_format=u Index: phpdoc-fr/reference/var/functions/is-numeric.xml diff -u phpdoc-fr/reference/var/functions/is-numeric.xml:1.13 phpdoc-fr/reference/var/functions/is-numeric.xml:1.14 --- phpdoc-fr/reference/var/functions/is-numeric.xml:1.13 Sat May 31 23:01:18 2008 +++ phpdoc-fr/reference/var/functions/is-numeric.xml Wed Jan 7 21:04:20 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> -<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.14 $ --> +<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.is-numeric" xmlns="http://docbook.org/ns/docbook"> @@ -25,6 +25,7 @@ mais uniquement sans un signe, sans décimale et sans partie exponentielle. </para> </refsect1> + <refsect1 role="parameters"> &reftitle.parameters; <para> @@ -40,6 +41,7 @@ </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> @@ -47,7 +49,43 @@ chaîne numérique, &false; sinon. </para> </refsect1> - <refsect1 role="seealso"> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>is_numeric</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$tests = Array( + "42", + 1337, + "1e4", + "not numeric", + Array(), + 9.1 + ); + +foreach($tests as $element) +{ + if(is_numeric($element)) + { + echo "'{$element}' is numeric", PHP_EOL; + } + else + { + echo "'{$element}' is NOT numeric", PHP_EOL; + } +} +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + +<refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/var/functions/is-object.xml?r1=1.14&r2=1.15&diff_format=u Index: phpdoc-fr/reference/var/functions/is-object.xml diff -u phpdoc-fr/reference/var/functions/is-object.xml:1.14 phpdoc-fr/reference/var/functions/is-object.xml:1.15 --- phpdoc-fr/reference/var/functions/is-object.xml:1.14 Sat May 31 23:01:18 2008 +++ phpdoc-fr/reference/var/functions/is-object.xml Wed Jan 7 21:04:20 2009 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.14 $ --> -<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready --> -<!-- Reviewed: no --> +<!-- $Revision: 1.15 $ --> +<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready --> +<!-- Reviewed: yes --> <refentry xml:id="function.is-object" xmlns="http://docbook.org/ns/docbook"> <refnamediv> @@ -40,6 +40,41 @@ &false; sinon. </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>is_object</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Déclare une simple fonction pour retourner un tableau +// de notre objet +function get_students($obj) +{ + if(!is_object($obj)) + { + return(false); + } + + return($obj->students); +} + +// Déclare une nouvelle instance et +// la remplit +$obj = new stdClass; +$obj->students = Array('Kalle', 'Ross', 'Felipe'); + +var_dump(get_students(NULL)); +var_dump(get_students($obj)); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="notes"> &reftitle.notes; <note> @@ -50,6 +85,7 @@ </para> </note> </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/var/functions/is-unicode.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-fr/reference/var/functions/is-unicode.xml diff -u phpdoc-fr/reference/var/functions/is-unicode.xml:1.4 phpdoc-fr/reference/var/functions/is-unicode.xml:1.5 --- phpdoc-fr/reference/var/functions/is-unicode.xml:1.4 Sat May 31 23:01:18 2008 +++ phpdoc-fr/reference/var/functions/is-unicode.xml Wed Jan 7 21:04:20 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.is-unicode" xmlns="http://docbook.org/ns/docbook"> @@ -44,6 +44,35 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>is_unicode</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Declare a unicode string +$unicode = 'Ceci est une chaîne unicode'; + +// Declare a binary string +$binary = b'Ceci est une chaîne binaire'; + +var_dump(is_unicode($unicode), is_bunicode($binary)); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +bool(true) +bool(false) +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/var/functions/strval.xml?r1=1.12&r2=1.13&diff_format=u Index: phpdoc-fr/reference/var/functions/strval.xml diff -u phpdoc-fr/reference/var/functions/strval.xml:1.12 phpdoc-fr/reference/var/functions/strval.xml:1.13 --- phpdoc-fr/reference/var/functions/strval.xml:1.12 Sun Jun 1 10:30:21 2008 +++ phpdoc-fr/reference/var/functions/strval.xml Wed Jan 7 21:04:20 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.12 $ --> -<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.13 $ --> +<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.strval" xmlns="http://docbook.org/ns/docbook"> @@ -51,6 +51,31 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>strval</function> et la méthode magique __toString</title> + <programlisting role="php"> +<![CDATA[ +<?php +class StrValTest +{ + public function __toString() + { + return __CLASS__; + } +} + +// Affiche 'StrValTest' +echo strval(new StrValTest); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/var/functions/unserialize.xml?r1=1.20&r2=1.21&diff_format=u Index: phpdoc-fr/reference/var/functions/unserialize.xml diff -u phpdoc-fr/reference/var/functions/unserialize.xml:1.20 phpdoc-fr/reference/var/functions/unserialize.xml:1.21 --- phpdoc-fr/reference/var/functions/unserialize.xml:1.20 Sun Jun 1 10:30:21 2008 +++ phpdoc-fr/reference/var/functions/unserialize.xml Wed Jan 7 21:04:20 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.20 $ --> -<!-- EN-Revision: 1.22 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.21 $ --> +<!-- EN-Revision: 1.23 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.unserialize" xmlns="http://docbook.org/ns/docbook">
« previous php.doc.fr (#6299) next »