mirror of
https://github.com/php/doc-tr.git
synced 2026-03-24 07:12:18 +01:00
181 lines
4.3 KiB
XML
181 lines
4.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- EN-Revision: f5a677b8fdc3f7f72f2225f906cac0e466d4558d Maintainer: nilgun Status: ready -->
|
||
<refentry xml:id="function.class-alias" xmlns="http://docbook.org/ns/docbook">
|
||
<refnamediv>
|
||
<refname>class_alias</refname>
|
||
<refpurpose>Sınıfa bir takma ad oluşturur</refpurpose>
|
||
</refnamediv>
|
||
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis>
|
||
<type>bool</type><methodname>class_alias</methodname>
|
||
<methodparam><type>string</type><parameter>sınıf</parameter></methodparam>
|
||
<methodparam><type>string</type><parameter>takma_ad</parameter></methodparam>
|
||
<methodparam choice="opt"><type>bool</type><parameter>otomatik_yükle</parameter><initializer>&true;</initializer></methodparam>
|
||
</methodsynopsis>
|
||
<para>
|
||
Kullanıcı tanımlı <parameter>sınıf</parameter> sınıfına
|
||
<parameter>takma_ad</parameter> adıyla bir sınıf oluşturur.
|
||
Takma adlı sınıf özgün sınıfla tamamen aynıdır.
|
||
</para>
|
||
<note>
|
||
<simpara>
|
||
PHP 8.3.0 ve sonrasında, <function>class_alias</function> ayrıca,
|
||
PHP dahili sınıflarına da takma ad oluşturuyor.
|
||
</simpara>
|
||
</note>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
<para>
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><parameter>sınıf</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Özgün sınıfın adı.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>takma_ad</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Sınıf için takma ad.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>otomatik_yükle</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Yüklü değilse <link linkend="language.oop5.autoload">autoload</link> çağrısı yapılıp yapılmayacağı.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</para>
|
||
</refsect1>
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
&return.success;
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="changelog">
|
||
&reftitle.changelog;
|
||
<informaltable>
|
||
<tgroup cols="2">
|
||
<thead>
|
||
<row>
|
||
<entry>&Version;</entry>
|
||
<entry>&Description;</entry>
|
||
</row>
|
||
</thead>
|
||
<tbody>
|
||
<row>
|
||
<entry>8.3.0</entry>
|
||
<entry>
|
||
<function>class_alias</function> artık PHP dahili sınıflarına da
|
||
takma ad oluşturabiliyor.
|
||
</entry>
|
||
</row>
|
||
</tbody>
|
||
</tgroup>
|
||
</informaltable>
|
||
</refsect1>
|
||
|
||
<refsect1 role="examples">
|
||
&reftitle.examples;
|
||
<para>
|
||
<example>
|
||
<title>- <function>class_alias</function> örneği</title>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
|
||
class Foo { }
|
||
|
||
class_alias('Foo', 'Bar');
|
||
|
||
$a = new Foo;
|
||
$b = new Bar;
|
||
|
||
// nesneler aynıdır
|
||
var_dump($a == $b, $a === $b);
|
||
var_dump($a instanceof $b);
|
||
|
||
// sınıflar aynıdır
|
||
var_dump($a instanceof Foo);
|
||
var_dump($a instanceof Bar);
|
||
|
||
var_dump($b instanceof Foo);
|
||
var_dump($b instanceof Bar);
|
||
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
&example.outputs;
|
||
<screen>
|
||
<![CDATA[
|
||
bool(true)
|
||
bool(false)
|
||
bool(true)
|
||
bool(true)
|
||
bool(true)
|
||
bool(true)
|
||
bool(true)
|
||
]]>
|
||
</screen>
|
||
</example>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="notes">
|
||
&reftitle.notes;
|
||
<note>
|
||
<para>
|
||
Sınıf adları PHP'de harf büyüklüğüne duyarlı değildir ve bu işlev için de
|
||
bu böyledir. <function>class_alias</function> tarafından oluşturulan takma
|
||
adlar küçük harfle bildirilir. Bu, <literal>Sınıfım</literal> sınıfı için,
|
||
<code>class_alias('Sınıfım', 'RumuzSınıfım')</code> çağrısının,
|
||
<literal>rumuzsınıfım</literal> adında yeni bir sınıf takma adı
|
||
bildireceği anlamına gelir.
|
||
</para>
|
||
</note>
|
||
</refsect1>
|
||
|
||
<refsect1 role="seealso">
|
||
&reftitle.seealso;
|
||
<para>
|
||
<simplelist>
|
||
<member><function>get_parent_class</function></member>
|
||
<member><function>is_subclass_of</function></member>
|
||
</simplelist>
|
||
</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:"~/.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
|
||
-->
|