mirror of
https://github.com/php/doc-de.git
synced 2026-03-24 07:12:15 +01:00
103 lines
3.2 KiB
XML
103 lines
3.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 14767af0f05dffa6fdb9b49e1a1f4e9ca7022a60 Maintainer: nobody Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<!-- Rev-Revision: bd8169a9b15cfa5007f060532c76d5f766cd4adf Reviewer: samesch -->
|
|
<reference xml:id="class.variant" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
<titleabbrev>variant</titleabbrev>
|
|
<title>Die Klasse variant</title>
|
|
<partintro>
|
|
|
|
<!-- {{{ variant intro -->
|
|
<section xml:id="variant.intro">
|
|
&reftitle.intro;
|
|
<para>
|
|
VARIANT ist COMs Pendant von PHPs zval; es ist eine Struktur, die einen
|
|
Wert einer Reihe unterschiedlicher möglicher Typen enthalten kann. Mit der
|
|
Klasse variant, die von der Erweiterung COM zur Verfügung gestellt wird,
|
|
kann die Art und Weise, wie PHP Werte an COM übergibt und von COM erhält,
|
|
besser kontrolliert werden.
|
|
</para>
|
|
</section>
|
|
<!-- }}} -->
|
|
|
|
<section xml:id="variant.synopsis">
|
|
&reftitle.classsynopsis;
|
|
|
|
<!-- {{{ Synopsis -->
|
|
<classsynopsis class="class">
|
|
<ooclass>
|
|
<classname>variant</classname>
|
|
</ooclass>
|
|
|
|
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
|
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.variant')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='variant'])">
|
|
<xi:fallback/>
|
|
</xi:include>
|
|
</classsynopsis>
|
|
<!-- }}} -->
|
|
|
|
</section>
|
|
|
|
<section xml:id="class.variant.examples">
|
|
<title>variant-Beispiele</title>
|
|
<para>
|
|
<example xml:id="com.variant.example.php5">
|
|
<title>variant-Beispiel</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$v = new variant(42);
|
|
print "Der Typ ist " . variant_get_type($v) . "<br/>";
|
|
print "Der Wert ist " . $v . "<br/>";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Wenn ein Wert zurückgegeben oder eine variant-Eigenschaft abgerufen wird,
|
|
wird variant nur dann in einen PHP-Wert konvertiert, wenn es eine
|
|
direkte, verlustlose Zuordnung zwischen den Typen gibt. In allen anderen
|
|
Fällen wird das Ergebnis als Instanz der variant-Klasse zurückgegeben. Es
|
|
ist möglich PHP zu zwingen, die Variante in einen nativen PHP-Typ zu
|
|
konvertieren, entweder durch explizite Verwendung eines Operators für die
|
|
Typumwandlung oder implizit durch die Umwandlung in einen String mittels
|
|
<function>print</function>. Die breite Palette von variant-Funktionen
|
|
kann verwendet werden, um arithmetische Operationen auf Varianten
|
|
durchzuführen, ohne eine Konvertierung zu erzwingen und damit
|
|
Datenverlust zu riskieren.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
Siehe auch <function>variant_get_type</function>.
|
|
</para>
|
|
</section>
|
|
|
|
</partintro>
|
|
|
|
&reference.com.entities.variant;
|
|
|
|
</reference>
|
|
<!-- 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:"~/.phpdoc/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
|
|
-->
|