mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-27 10:22:07 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@172385 c90b9560-bf6c-de11-be94-00142212c4b1
94 lines
2.2 KiB
XML
94 lines
2.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.10 $ -->
|
|
<!-- EN-Revision: 1.7 Maintainer: dams Status: ready -->
|
|
<refentry id="function.get-class">
|
|
<refnamediv>
|
|
<refname>get_class</refname>
|
|
<refpurpose>Retourne la classe d'un objet</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>get_class</methodname>
|
|
<methodparam><type>object</type><parameter>obj</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>get_class</function> retourne la classe de l'objet
|
|
<parameter>obj</parameter>. <function>get_class</function> retourne
|
|
&false; si <parameter>obj</parameter> n'est pas un objet.
|
|
</para>
|
|
<note>
|
|
<simpara>
|
|
<function>get_class</function> retourne un nom de classe utilisateur,
|
|
en minuscules. Une classe définie par une extension &php; est retournée
|
|
dans sa notation originale.
|
|
</simpara>
|
|
</note>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>get_class</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
class foo {
|
|
function foo() {
|
|
// un peu de code
|
|
}
|
|
|
|
function name() {
|
|
echo "Mon nom est " , get_class($this) , "\n";
|
|
}
|
|
}
|
|
|
|
// create an object
|
|
$bar = new foo();
|
|
|
|
// external call
|
|
echo "Son nom est " , get_class($bar) , "\n";
|
|
|
|
// internal call
|
|
$bar->name();
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Son nom est foo
|
|
Mon nom est foo
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Voir aussi
|
|
<function>get_parent_class</function>,
|
|
<function>gettype</function> et
|
|
<function>is_subclass_of</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- 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
|
|
-->
|