cvs: phpdoc-nl /reference/math/functions exp.xml log.xml mt-rand.xml /reference/var ini.xml reference.xml /reference/var/functions isset.xml
print-r.xml serialize.xml unserialize.xml
| From: | Sander Roobol | Date: | Sat, 04 Jan 2003 13:38:48 +0000 |
| Subject: | cvs: phpdoc-nl /reference/math/functions exp.xml log.xml mt-rand.xml /reference/var ini.xml reference.xml /reference/var/functions isset.xml print-r.xml serialize.xml unserialize.xml |
||
| Groups: | php.doc.nl | ||
| Request: | Send a blank email to doc-nl+get-207@lists.php.net to get a copy of this message | ||
sander Sat Jan 4 08:38:48 2003 EDT
Added files:
/phpdoc-nl/reference/var ini.xml
Modified files:
/phpdoc-nl/reference/math/functions exp.xml log.xml mt-rand.xml
/phpdoc-nl/reference/var reference.xml
/phpdoc-nl/reference/var/functions isset.xml print-r.xml
serialize.xml unserialize.xml
Log:
Sync with EN
Index: phpdoc-nl/reference/math/functions/exp.xml diff -u phpdoc-nl/reference/math/functions/exp.xml:1.2 phpdoc-nl/reference/math/functions/exp.xml:1.3 --- phpdoc-nl/reference/math/functions/exp.xml:1.2 Fri Aug 16 05:27:42 2002 +++ phpdoc-nl/reference/math/functions/exp.xml Sat Jan 4 08:38:46 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: sander Status: ready --> <refentry id="function.exp"> <refnamediv> <refname>exp</refname> - <refpurpose>verhef e tot de ...e macht</refpurpose> + <refpurpose>Berekent een exponent van <constant>e</constant> (het grondtal van de de natuurlijke logaritme of het logaritme van Neper)</refpurpose> </refnamediv> <refsect1> <title>Beschrijving</title> @@ -12,7 +12,7 @@ <methodparam><type>float</type><parameter>arg</parameter></methodparam> </methodsynopsis> <para> - Geeft de <parameter>arg</parameter>e macht van e terug. + Geeft de <parameter>arg</parameter>e macht van <constant>e</constant> terug. </para> <para> Zie ook: <function>pow</function>. Index: phpdoc-nl/reference/math/functions/log.xml diff -u phpdoc-nl/reference/math/functions/log.xml:1.2 phpdoc-nl/reference/math/functions/log.xml:1.3 --- phpdoc-nl/reference/math/functions/log.xml:1.2 Fri Aug 16 05:27:42 2002 +++ phpdoc-nl/reference/math/functions/log.xml Sat Jan 4 08:38:46 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: sander Status: ready --> <refentry id="function.log"> <refnamediv> <refname>log</refname> @@ -10,10 +10,26 @@ <methodsynopsis> <type>float</type><methodname>log</methodname> <methodparam><type>float</type><parameter>arg</parameter></methodparam> + <methodparam choice="opt"><type>float</type><parameter>base</parameter></methodparam> </methodsynopsis> <para> - Geeft de natuurlijke logaritme van arg terug. + Als het optionele <parameter>base</parameter> argument is gegeven, zal + <function>log</function> + log<subscript>base</subscript><parameter>arg</parameter> teruggeven, + anders geeft <function>log</function> de natuurlijke logaritme van + <parameter>arg</parameter> terug. </para> + <note> + <para> + De <parameter>base</parameter> parameter is nieuw in PHP versie 4.3.0. + </para> + <para> + Zoals altijd kan je de logaritme met grondtal <literal>b</literal> van + een getal <literal>n</literal> berekend worden met de formule: + log<subscript>b</subscript>(n) = log(n)/log(b) waarbij log de natuurlijke + logaritme (of logaritme van Neper) is. + </para> + </note> </refsect1> </refentry> Index: phpdoc-nl/reference/math/functions/mt-rand.xml diff -u phpdoc-nl/reference/math/functions/mt-rand.xml:1.2 phpdoc-nl/reference/math/functions/mt-rand.xml:1.3 --- phpdoc-nl/reference/math/functions/mt-rand.xml:1.2 Fri Aug 16 05:27:42 2002 +++ phpdoc-nl/reference/math/functions/mt-rand.xml Sat Jan 4 08:38:46 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: sander Status: ready --> <refentry id="function.mt-rand"> <refnamediv> <refname>mt_rand</refname> @@ -18,14 +18,10 @@ libc random number genetor met de <function>rand</function> functie. De <function>mt_rand</function> functie is vervanger voor deze functie. Deze functie gebruikt een random number generator met bekende - eigenschappen, de Mersenne Twister, die willekeurige getallen genereerd - die geschikt moeten zijn voor allerlei soorten cryptografie (zie de - homepage voor details) en is vier keer zo snel dan wat de gemiddelde libc - geeft. De homepage van de Mersenne Twister kun je vinden op - <ulink url="&url.mersenne;">&url.mersenne;</ulink>, en een - geoptimalizeerde versie van de MT broncode is beschikbaar op - <ulink url="&url.mersenne.twister;">&url.mersenne.twister; - </ulink>. + eigenschappen, de <ulink url="&url.mersenne;">Mersenne Twister</ulink>, + die willekeurige getallen genereerd die geschikt moeten zijn voor allerlei + soorten cryptografie (zie de homepage voor details) en is vier keer zo + snel dan wat de gemiddelde libc geeft. </simpara> <simpara> Als deze functie wordt aangeroepen zonder de optionele argumenten Index: phpdoc-nl/reference/var/reference.xml diff -u phpdoc-nl/reference/var/reference.xml:1.2 phpdoc-nl/reference/var/reference.xml:1.3 --- phpdoc-nl/reference/var/reference.xml:1.2 Wed Aug 14 06:14:11 2002 +++ phpdoc-nl/reference/var/reference.xml Sat Jan 4 08:38:47 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: sander Status: ready --> <reference id="ref.variables"> <title>Variabelen gerelateerde Functies</title> <titleabbrev>Variabelen</titleabbrev> @@ -13,27 +13,19 @@ handleiding. </para> </section> - <section id="variables.requirements"> &reftitle.required; &no.requirement; </section> - <section id="variables.installation"> &reftitle.install; &no.install; </section> - - <section id="variables.configuration"> - &reftitle.runtime; - &no.config; - </section> - + &reference.var.ini; <section id="variables.resources"> &reftitle.resources; &no.resource; </section> - <section id="variables.constants"> &reftitle.constants; &no.constants; Index: phpdoc-nl/reference/var/functions/isset.xml diff -u phpdoc-nl/reference/var/functions/isset.xml:1.3 phpdoc-nl/reference/var/functions/isset.xml:1.4 --- phpdoc-nl/reference/var/functions/isset.xml:1.3 Fri Aug 16 05:27:22 2002 +++ phpdoc-nl/reference/var/functions/isset.xml Sat Jan 4 08:38:47 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.5 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: sander Status: ready --> <refentry id="function.isset"> <refnamediv> <refname>isset</refname> @@ -27,39 +27,65 @@ <function>isset</function> zal &false; teruggeven als je een variabel test die waarde &null; heeft. Merk op dat een &null; byte (<literal>"\0"</literal>) niet gelijk is aan de PHP constante &null;. - <informalexample> - <programlisting role="php"> + </para> + <note> + <title>Warning</title> + <para> + <function>isset</function> werkt alleen met variabelen. Als je iets + anders als argument geeft krijg je een parse error. Om te kijken of + <link linkend="language.constants">constantes</link> gedefinieerd zijn + gebruik je de <function>defined</function> functie. + </para> + </note> + <informalexample> + <programlisting role="php"> <![CDATA[ <?php - $a = "test"; - $b = "anothertest"; - echo isset ($a); // TRUE - echo isset ($a, $b); //TRUE +$var = ''; + +// Dit zal &true; opleveren, dus de text zal worden weergegeven. +if (isset($var)) { + print "This var is set set so I will print."; +} + +// In de volgende voorbeelden gebruiken we var_dump() om +// de waarde die isset() terug geeft weer te geven. + +$a = "test"; +$b = "nogeentest"; + +var_dump( isset($a) ); // TRUE +var_dump( isset ($a, $b) ); // TRUE - unset ($a); - echo isset ($a); // FALSE - echo isset ($a, $b); //FALSE +unset ($a); + +var_dump( isset ($a) ); // FALSE +var_dump( isset ($a, $b) ); // FALSE $foo = NULL; - print isset ($foo); // FALSE +var_dump( isset ($foo) ); // FALSE + ?> ]]> - </programlisting> - </informalexample> - </para> + </programlisting> + </informalexample> <para> Dit werkt ook voor elementen in arrays: <informalexample> <programlisting role="php"> <![CDATA[ <?php - $a = array ('test' => 1, 'hello' => null); - echo isset ($a['test']); // TRUE - echo isset ($a['foo']); // FALSE - echo isset ($a['hello']); // FALSE - echo array_key_exists('hello', $a); // TRUE +$a = array ('test' => 1, 'hallo' => NULL); + +var_dump( isset ($a['test']) ); // TRUE +var_dump( isset ($a['foo']) ); // FALSE +var_dump( isset ($a['hallo']) ); // FALSE + +// De key 'hallo' is gelijk aan NULL, dus geeft isset() FALSE terug. +// Als je ook naar NULL waarden in arrays wil kijken, kan je dit gebruiken: +var_dump( array_key_exists('hello', $a) ); // TRUE ?> ]]> </programlisting> @@ -67,8 +93,9 @@ </para> <simpara> Zie ook: <function>empty</function>, - <function>unset</function>, en - <function>array_key_exists</function>. + <function>unset</function>, <function>defined</function>, + <function>array_key_exists</function> en de errorbesturings operator + <link linkend="language.operators.errorcontrol">@</link>. </simpara> </refsect1> </refentry> Index: phpdoc-nl/reference/var/functions/print-r.xml diff -u phpdoc-nl/reference/var/functions/print-r.xml:1.2 phpdoc-nl/reference/var/functions/print-r.xml:1.3 --- phpdoc-nl/reference/var/functions/print-r.xml:1.2 Fri Aug 16 05:27:22 2002 +++ phpdoc-nl/reference/var/functions/print-r.xml Sat Jan 4 08:38:47 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: sander Status: ready --> <refentry id="function.print-r"> <refnamediv> <refname>print_r</refname> @@ -10,7 +10,7 @@ <refsect1> <title>Beschrijving</title> <methodsynopsis> - <type>void</type><methodname>print_r</methodname> + <type>bool</type><methodname>print_r</methodname> <methodparam><type>mixed</type><parameter>expression</parameter></methodparam> </methodsynopsis> <simpara> Index: phpdoc-nl/reference/var/functions/serialize.xml diff -u phpdoc-nl/reference/var/functions/serialize.xml:1.2 phpdoc-nl/reference/var/functions/serialize.xml:1.3 --- phpdoc-nl/reference/var/functions/serialize.xml:1.2 Fri Aug 16 05:27:22 2002 +++ phpdoc-nl/reference/var/functions/serialize.xml Sat Jan 4 08:38:47 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: sander Status: ready --> <refentry id="function.serialize"> <refnamediv> <refname>serialize</refname> @@ -30,6 +30,14 @@ <function>serialize</function>ren. De verwijzingen in de array of het object dat je aan het <function>serialize</function>n bent zullen ook worden opgeslagen. + </simpara> + <simpara> + Als je objecten gaat serializen, dan zal PHP proberen de functie + <function>__sleep()</function> van dat object aan te roepen voor het + serializeren. Dit om het object de mogelijkheid te geven dingen op te + schonen voor het serializen. Op dezelfde manier wordt de + <function>__wakeup()</function> functie aangeroepen als het object is + gereconstrueerd met de <function>unserialize</function> functie. </simpara> <!-- TODO in 4.0.4pl1 this didn't work properly, however, there Index: phpdoc-nl/reference/var/functions/unserialize.xml diff -u phpdoc-nl/reference/var/functions/unserialize.xml:1.2 phpdoc-nl/reference/var/functions/unserialize.xml:1.3 --- phpdoc-nl/reference/var/functions/unserialize.xml:1.2 Fri Aug 16 05:27:22 2002 +++ phpdoc-nl/reference/var/functions/unserialize.xml Sat Jan 4 08:38:47 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.10 Maintainer: sander Status: ready --> <refentry id="function.unserialize"> <refnamediv> <refname>unserialize</refname> @@ -12,6 +12,7 @@ <methodsynopsis> <type>mixed</type><methodname>unserialize</methodname> <methodparam><type>string</type><parameter>str</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>callback</parameter></methodparam> </methodsynopsis> <simpara> <function>unserialize</function> neemt een enkele geserializeerde @@ -19,6 +20,8 @@ naar een PHP waarde. De geconverteerde waarde wordt teruggeven, en kan een <type>integer</type>, <type>float</type>, <type>string</type>, <type>array</type> of een <type>object</type> zijn. + Als de meegegeven string niet correct worden ingelezen, zal deze functie + &false; teruggeven. </simpara> <note> <para> @@ -26,26 +29,32 @@ aangeroepen als een ongedefinieerde class wordt opgeroepen tijdens het unserializen (om te voorkomen dat je een incompleet <type>object</type> "__PHP_Incomplete_Class" krijgt.) - Gebruik je &php.ini;, <function>ini_set</function> of .htaccess-bestand + Gebruik je &php.ini;, <function>ini_set</function> of <filename>.htaccess</filename>-bestand of 'unserialize_callback_func' in te stellen. Elke keer een ongedefinieerde class zou worden opgeroepen, wordt die functie aangeroepen. Om deze optie uit te zetten, moet je deze instelling gewoon leeg laten. + Merk op dat de ini-instelling unserialize_callback_function nieuw is sinds PHP 4.2.0. </para> </note> <para> + Als de variable die wordt geunserialized een object is, zal PHP + automatisch proberen de <function>__wakeup</function> functie van die + class aan te roepen als deze functie beschikbaar is en het object + succesvol kon worden gereconstrueerd. <example> <title>unserialize_callback_func voorbeeld</title> <programlisting role="php"> <![CDATA[ +<?php $serialized_object='O:1:"a":1:{s:5:"value";s:3:"100";}'; - +// unserialize_callback_func is beschikbaar sinds PHP 4.2.0 ini_set('unserialize_callback_func','mycallback'); // stel je callback_function in - function mycallback($classname) { // include hier een bestand dat de classdefinitie bevat // je krijgt $classname om uit te zoeken welke definitie je nodig hebt } +?> ]]> </programlisting> </example> @@ -65,6 +74,7 @@ <title><function>unserialize</function> example</title> <programlisting role="php"> <![CDATA[ +<?php // Hier gebruiken we unserialize() om de sessie data in de // $session_data array te laden van de string die we uit een database // halen. Dit voorbeeld maakt het voorbeeld bij serialize() af. @@ -83,6 +93,7 @@ $session_data = array(); } } +?> ]]> </programlisting> </example> Index: phpdoc-nl/reference/var/ini.xml +++ phpdoc-nl/reference/var/ini.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- EN-Revision: 1.1 Maintainer: sander Status: ready --> <section id="var.configuration"> &reftitle.runtime; &extension.runtime; <para> <table> <title> Configuratie opties voor variabelen</title> <tgroup cols="3"> <thead> <row> <entry>Naam</entry> <entry>Standaard waarde</entry> <entry>Aanpasbaar</entry> </row> </thead> <tbody> <row> <entry>unserialize_callback_func</entry> <entry>""</entry> <entry>PHP_INI_ALL</entry> </row> </tbody> </tgroup> </table> Voor meer details over de definitie van de PHP_INI_* constantes zie <function>ini_set</function>. </para> <para> Hier is een korte uitleg van de configuratieopties. <variablelist> <varlistentry id="unserialize-callback-func"> <term> <parameter>unserialize_callback_func</parameter> <type>string</type> </term> <listitem> <para> De unserialize callback functie zal worden aangeroepen (met de ongedefineerde class-naam als argument) als de unserializer een ongedefinieerde class tegenkomt. Een waarschuwing zal worden weergegeven als de functie niet is gedefineerd of als de functie de ontbrekende class niet implementeerd. Gebruik deze optie dus alleen als je ook echt zo'n functie wil implementeren. </para> <para> Zie ook <function>unserialize</function>. </para> </listitem> </varlistentry> </variablelist> </para> </section> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
Index: phpdoc-nl/reference/math/functions/exp.xml diff -u phpdoc-nl/reference/math/functions/exp.xml:1.2 phpdoc-nl/reference/math/functions/exp.xml:1.3 --- phpdoc-nl/reference/math/functions/exp.xml:1.2 Fri Aug 16 05:27:42 2002 +++ phpdoc-nl/reference/math/functions/exp.xml Sat Jan 4 08:38:46 2003 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: sander Status: ready --> <refentry id="function.exp"> <refnamediv> <refname>exp</refname> - <refpurpose>verhef e tot de ...e macht</refpurpose> + <refpurpose>Berekent een exponent van <constant>e</constant> (het grondtal van de de natuurlijke logaritme of het logaritme van Neper)</refpurpose> </refnamediv> <refsect1> <title>Beschrijving</title> @@ -12,7 +12,7 @@ <methodparam><type>float</type><parameter>arg</parameter></methodparam> </methodsynopsis> <para> - Geeft de <parameter>arg</parameter>e macht van e terug. + Geeft de <parameter>arg</parameter>e macht van <constant>e</constant> terug. </para> <para> Zie ook: <function>pow</function>. Index: phpdoc-nl/reference/math/functions/log.xml diff -u phpdoc-nl/reference/math/functions/log.xml:1.2 phpdoc-nl/reference/math/functions/log.xml:1.3 --- phpdoc-nl/reference/math/functions/log.xml:1.2 Fri Aug 16 05:27:42 2002 +++ phpdoc-nl/reference/math/functions/log.xml Sat Jan 4 08:38:46 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: sander Status: ready --> <refentry id="function.log"> <refnamediv> <refname>log</refname> @@ -10,10 +10,26 @@ <methodsynopsis> <type>float</type><methodname>log</methodname> <methodparam><type>float</type><parameter>arg</parameter></methodparam> + <methodparam choice="opt"><type>float</type><parameter>base</parameter></methodparam> </methodsynopsis> <para> - Geeft de natuurlijke logaritme van arg terug. + Als het optionele <parameter>base</parameter> argument is gegeven, zal + <function>log</function> + log<subscript>base</subscript><parameter>arg</parameter> teruggeven, + anders geeft <function>log</function> de natuurlijke logaritme van + <parameter>arg</parameter> terug. </para> + <note> + <para> + De <parameter>base</parameter> parameter is nieuw in PHP versie 4.3.0. + </para> + <para> + Zoals altijd kan je de logaritme met grondtal <literal>b</literal> van + een getal <literal>n</literal> berekend worden met de formule: + log<subscript>b</subscript>(n) = log(n)/log(b) waarbij log de natuurlijke + logaritme (of logaritme van Neper) is. + </para> + </note> </refsect1> </refentry> Index: phpdoc-nl/reference/math/functions/mt-rand.xml diff -u phpdoc-nl/reference/math/functions/mt-rand.xml:1.2 phpdoc-nl/reference/math/functions/mt-rand.xml:1.3 --- phpdoc-nl/reference/math/functions/mt-rand.xml:1.2 Fri Aug 16 05:27:42 2002 +++ phpdoc-nl/reference/math/functions/mt-rand.xml Sat Jan 4 08:38:46 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: sander Status: ready --> <refentry id="function.mt-rand"> <refnamediv> <refname>mt_rand</refname> @@ -18,14 +18,10 @@ libc random number genetor met de <function>rand</function> functie. De <function>mt_rand</function> functie is vervanger voor deze functie. Deze functie gebruikt een random number generator met bekende - eigenschappen, de Mersenne Twister, die willekeurige getallen genereerd - die geschikt moeten zijn voor allerlei soorten cryptografie (zie de - homepage voor details) en is vier keer zo snel dan wat de gemiddelde libc - geeft. De homepage van de Mersenne Twister kun je vinden op - <ulink url="&url.mersenne;">&url.mersenne;</ulink>, en een - geoptimalizeerde versie van de MT broncode is beschikbaar op - <ulink url="&url.mersenne.twister;">&url.mersenne.twister; - </ulink>. + eigenschappen, de <ulink url="&url.mersenne;">Mersenne Twister</ulink>, + die willekeurige getallen genereerd die geschikt moeten zijn voor allerlei + soorten cryptografie (zie de homepage voor details) en is vier keer zo + snel dan wat de gemiddelde libc geeft. </simpara> <simpara> Als deze functie wordt aangeroepen zonder de optionele argumenten Index: phpdoc-nl/reference/var/reference.xml diff -u phpdoc-nl/reference/var/reference.xml:1.2 phpdoc-nl/reference/var/reference.xml:1.3 --- phpdoc-nl/reference/var/reference.xml:1.2 Wed Aug 14 06:14:11 2002 +++ phpdoc-nl/reference/var/reference.xml Sat Jan 4 08:38:47 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: sander Status: ready --> <reference id="ref.variables"> <title>Variabelen gerelateerde Functies</title> <titleabbrev>Variabelen</titleabbrev> @@ -13,27 +13,19 @@ handleiding. </para> </section> - <section id="variables.requirements"> &reftitle.required; &no.requirement; </section> - <section id="variables.installation"> &reftitle.install; &no.install; </section> - - <section id="variables.configuration"> - &reftitle.runtime; - &no.config; - </section> - + &reference.var.ini; <section id="variables.resources"> &reftitle.resources; &no.resource; </section> - <section id="variables.constants"> &reftitle.constants; &no.constants; Index: phpdoc-nl/reference/var/functions/isset.xml diff -u phpdoc-nl/reference/var/functions/isset.xml:1.3 phpdoc-nl/reference/var/functions/isset.xml:1.4 --- phpdoc-nl/reference/var/functions/isset.xml:1.3 Fri Aug 16 05:27:22 2002 +++ phpdoc-nl/reference/var/functions/isset.xml Sat Jan 4 08:38:47 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.5 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: sander Status: ready --> <refentry id="function.isset"> <refnamediv> <refname>isset</refname> @@ -27,39 +27,65 @@ <function>isset</function> zal &false; teruggeven als je een variabel test die waarde &null; heeft. Merk op dat een &null; byte (<literal>"\0"</literal>) niet gelijk is aan de PHP constante &null;. - <informalexample> - <programlisting role="php"> + </para> + <note> + <title>Warning</title> + <para> + <function>isset</function> werkt alleen met variabelen. Als je iets + anders als argument geeft krijg je een parse error. Om te kijken of + <link linkend="language.constants">constantes</link> gedefinieerd zijn + gebruik je de <function>defined</function> functie. + </para> + </note> + <informalexample> + <programlisting role="php"> <![CDATA[ <?php - $a = "test"; - $b = "anothertest"; - echo isset ($a); // TRUE - echo isset ($a, $b); //TRUE +$var = ''; + +// Dit zal &true; opleveren, dus de text zal worden weergegeven. +if (isset($var)) { + print "This var is set set so I will print."; +} + +// In de volgende voorbeelden gebruiken we var_dump() om +// de waarde die isset() terug geeft weer te geven. + +$a = "test"; +$b = "nogeentest"; + +var_dump( isset($a) ); // TRUE +var_dump( isset ($a, $b) ); // TRUE - unset ($a); - echo isset ($a); // FALSE - echo isset ($a, $b); //FALSE +unset ($a); + +var_dump( isset ($a) ); // FALSE +var_dump( isset ($a, $b) ); // FALSE $foo = NULL; - print isset ($foo); // FALSE +var_dump( isset ($foo) ); // FALSE + ?> ]]> - </programlisting> - </informalexample> - </para> + </programlisting> + </informalexample> <para> Dit werkt ook voor elementen in arrays: <informalexample> <programlisting role="php"> <![CDATA[ <?php - $a = array ('test' => 1, 'hello' => null); - echo isset ($a['test']); // TRUE - echo isset ($a['foo']); // FALSE - echo isset ($a['hello']); // FALSE - echo array_key_exists('hello', $a); // TRUE +$a = array ('test' => 1, 'hallo' => NULL); + +var_dump( isset ($a['test']) ); // TRUE +var_dump( isset ($a['foo']) ); // FALSE +var_dump( isset ($a['hallo']) ); // FALSE + +// De key 'hallo' is gelijk aan NULL, dus geeft isset() FALSE terug. +// Als je ook naar NULL waarden in arrays wil kijken, kan je dit gebruiken: +var_dump( array_key_exists('hello', $a) ); // TRUE ?> ]]> </programlisting> @@ -67,8 +93,9 @@ </para> <simpara> Zie ook: <function>empty</function>, - <function>unset</function>, en - <function>array_key_exists</function>. + <function>unset</function>, <function>defined</function>, + <function>array_key_exists</function> en de errorbesturings operator + <link linkend="language.operators.errorcontrol">@</link>. </simpara> </refsect1> </refentry> Index: phpdoc-nl/reference/var/functions/print-r.xml diff -u phpdoc-nl/reference/var/functions/print-r.xml:1.2 phpdoc-nl/reference/var/functions/print-r.xml:1.3 --- phpdoc-nl/reference/var/functions/print-r.xml:1.2 Fri Aug 16 05:27:22 2002 +++ phpdoc-nl/reference/var/functions/print-r.xml Sat Jan 4 08:38:47 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: sander Status: ready --> <refentry id="function.print-r"> <refnamediv> <refname>print_r</refname> @@ -10,7 +10,7 @@ <refsect1> <title>Beschrijving</title> <methodsynopsis> - <type>void</type><methodname>print_r</methodname> + <type>bool</type><methodname>print_r</methodname> <methodparam><type>mixed</type><parameter>expression</parameter></methodparam> </methodsynopsis> <simpara> Index: phpdoc-nl/reference/var/functions/serialize.xml diff -u phpdoc-nl/reference/var/functions/serialize.xml:1.2 phpdoc-nl/reference/var/functions/serialize.xml:1.3 --- phpdoc-nl/reference/var/functions/serialize.xml:1.2 Fri Aug 16 05:27:22 2002 +++ phpdoc-nl/reference/var/functions/serialize.xml Sat Jan 4 08:38:47 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: sander Status: ready --> <refentry id="function.serialize"> <refnamediv> <refname>serialize</refname> @@ -30,6 +30,14 @@ <function>serialize</function>ren. De verwijzingen in de array of het object dat je aan het <function>serialize</function>n bent zullen ook worden opgeslagen. + </simpara> + <simpara> + Als je objecten gaat serializen, dan zal PHP proberen de functie + <function>__sleep()</function> van dat object aan te roepen voor het + serializeren. Dit om het object de mogelijkheid te geven dingen op te + schonen voor het serializen. Op dezelfde manier wordt de + <function>__wakeup()</function> functie aangeroepen als het object is + gereconstrueerd met de <function>unserialize</function> functie. </simpara> <!-- TODO in 4.0.4pl1 this didn't work properly, however, there Index: phpdoc-nl/reference/var/functions/unserialize.xml diff -u phpdoc-nl/reference/var/functions/unserialize.xml:1.2 phpdoc-nl/reference/var/functions/unserialize.xml:1.3 --- phpdoc-nl/reference/var/functions/unserialize.xml:1.2 Fri Aug 16 05:27:22 2002 +++ phpdoc-nl/reference/var/functions/unserialize.xml Sat Jan 4 08:38:47 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: sander Status: ready --> +<!-- EN-Revision: 1.10 Maintainer: sander Status: ready --> <refentry id="function.unserialize"> <refnamediv> <refname>unserialize</refname> @@ -12,6 +12,7 @@ <methodsynopsis> <type>mixed</type><methodname>unserialize</methodname> <methodparam><type>string</type><parameter>str</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>callback</parameter></methodparam> </methodsynopsis> <simpara> <function>unserialize</function> neemt een enkele geserializeerde @@ -19,6 +20,8 @@ naar een PHP waarde. De geconverteerde waarde wordt teruggeven, en kan een <type>integer</type>, <type>float</type>, <type>string</type>, <type>array</type> of een <type>object</type> zijn. + Als de meegegeven string niet correct worden ingelezen, zal deze functie + &false; teruggeven. </simpara> <note> <para> @@ -26,26 +29,32 @@ aangeroepen als een ongedefinieerde class wordt opgeroepen tijdens het unserializen (om te voorkomen dat je een incompleet <type>object</type> "__PHP_Incomplete_Class" krijgt.) - Gebruik je &php.ini;, <function>ini_set</function> of .htaccess-bestand + Gebruik je &php.ini;, <function>ini_set</function> of <filename>.htaccess</filename>-bestand of 'unserialize_callback_func' in te stellen. Elke keer een ongedefinieerde class zou worden opgeroepen, wordt die functie aangeroepen. Om deze optie uit te zetten, moet je deze instelling gewoon leeg laten. + Merk op dat de ini-instelling unserialize_callback_function nieuw is sinds PHP 4.2.0. </para> </note> <para> + Als de variable die wordt geunserialized een object is, zal PHP + automatisch proberen de <function>__wakeup</function> functie van die + class aan te roepen als deze functie beschikbaar is en het object + succesvol kon worden gereconstrueerd. <example> <title>unserialize_callback_func voorbeeld</title> <programlisting role="php"> <![CDATA[ +<?php $serialized_object='O:1:"a":1:{s:5:"value";s:3:"100";}'; - +// unserialize_callback_func is beschikbaar sinds PHP 4.2.0 ini_set('unserialize_callback_func','mycallback'); // stel je callback_function in - function mycallback($classname) { // include hier een bestand dat de classdefinitie bevat // je krijgt $classname om uit te zoeken welke definitie je nodig hebt } +?> ]]> </programlisting> </example> @@ -65,6 +74,7 @@ <title><function>unserialize</function> example</title> <programlisting role="php"> <![CDATA[ +<?php // Hier gebruiken we unserialize() om de sessie data in de // $session_data array te laden van de string die we uit een database // halen. Dit voorbeeld maakt het voorbeeld bij serialize() af. @@ -83,6 +93,7 @@ $session_data = array(); } } +?> ]]> </programlisting> </example> Index: phpdoc-nl/reference/var/ini.xml +++ phpdoc-nl/reference/var/ini.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- EN-Revision: 1.1 Maintainer: sander Status: ready --> <section id="var.configuration"> &reftitle.runtime; &extension.runtime; <para> <table> <title> Configuratie opties voor variabelen</title> <tgroup cols="3"> <thead> <row> <entry>Naam</entry> <entry>Standaard waarde</entry> <entry>Aanpasbaar</entry> </row> </thead> <tbody> <row> <entry>unserialize_callback_func</entry> <entry>""</entry> <entry>PHP_INI_ALL</entry> </row> </tbody> </tgroup> </table> Voor meer details over de definitie van de PHP_INI_* constantes zie <function>ini_set</function>. </para> <para> Hier is een korte uitleg van de configuratieopties. <variablelist> <varlistentry id="unserialize-callback-func"> <term> <parameter>unserialize_callback_func</parameter> <type>string</type> </term> <listitem> <para> De unserialize callback functie zal worden aangeroepen (met de ongedefineerde class-naam als argument) als de unserializer een ongedefinieerde class tegenkomt. Een waarschuwing zal worden weergegeven als de functie niet is gedefineerd of als de functie de ontbrekende class niet implementeerd. Gebruik deze optie dus alleen als je ook echt zo'n functie wil implementeren. </para> <para> Zie ook <function>unserialize</function>. </para> </listitem> </varlistentry> </variablelist> </para> </section> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->