mirror of
https://github.com/php/doc-tr.git
synced 2026-03-23 23:02:09 +01:00
update for sync with English docs.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 6e67c80bc7aa82dd5bb272837ce8d54d57efabb1 Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: a049ea0cfbd4bf2554f0a134d4f0696d3d419b9b Maintainer: nilgun Status: ready -->
|
||||
<appendix xml:id="reserved" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Yerleşik Sözcüklerin Listesi</title>
|
||||
<para>
|
||||
@@ -215,6 +215,9 @@
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<link linkend="language.oop5.properties.readonly-properties">readonly</link> (PHP 8.1.0 ve sonrası) *
|
||||
</entry>
|
||||
<entry>
|
||||
<function>require</function>
|
||||
</entry>
|
||||
@@ -227,11 +230,11 @@
|
||||
<entry>
|
||||
<link linkend="language.variables.scope">static</link>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<link linkend="control-structures.switch">switch</link>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<link linkend="language.exceptions">throw</link>
|
||||
</entry>
|
||||
@@ -244,11 +247,11 @@
|
||||
<entry>
|
||||
<function>unset</function>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<link linkend="language.namespaces">use</link>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<link linkend="language.oop5.properties">var</link>
|
||||
</entry>
|
||||
@@ -261,13 +264,24 @@
|
||||
<entry>
|
||||
<link linkend="language.generators">yield</link>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<link linkend="control-structures.yield.from">yield from</link>
|
||||
</entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
||||
<simpara>
|
||||
* <literal>readonly</literal> işlev ismi olarak kullanılabilir.
|
||||
</simpara>
|
||||
|
||||
<table>
|
||||
<title>Derleme sabitleri</title>
|
||||
<tgroup cols="5">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: dfa86bcd6d25c244c5c18d8da25878dd71e299df Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 0a192fcd9cc43c0007de795063b4494974058992 Maintainer: nilgun Status: ready -->
|
||||
<!-- CREDITS: cumhuronat, tpug, antimon, flarecaster -->
|
||||
|
||||
<!ENTITY installation.enabled.disable 'Bu eklenti öntanımlı olarak etkindir.
|
||||
@@ -798,6 +798,17 @@ bulunabilir. Bu işlevden dönen değeri sınamak için
|
||||
<link linkend="language.operators.comparison"><literal>===</literal>
|
||||
işleci</link> kullanılabilir.</simpara></warning>'>
|
||||
|
||||
<!-- Standard -->
|
||||
<!ENTITY standard.changelog.calling-on-objects '<row xmlns="http://docbook.org/ns/docbook">
|
||||
<entry>8.1.0</entry>
|
||||
<entry>
|
||||
Bu işlevin nesnelerden çağrılması artık önerilmiyor.
|
||||
Ya <classname>ArrayIterator</classname> ya da nesne üzerinde önce
|
||||
<function>get_mangled_object_vars</function> kullanın.
|
||||
</entry>
|
||||
</row>
|
||||
'>
|
||||
|
||||
<!-- FileInfo -->
|
||||
<!ENTITY fileinfo.parameters.finfo '<para xmlns="http://docbook.org/ns/docbook">
|
||||
<function>finfo_open</function> işlevinden dönen
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 9bdf88f157a8b9363999e5287ca5e1ef93841f9e Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 93cc19efef135794877bc9013f7f891b459f4989 Maintainer: nilgun Status: ready -->
|
||||
<chapter xml:id="language.attributes" xmlns="http://docbook.org/ns/docbook">
|
||||
<title>Öznitelikler</title>
|
||||
<sect1 xml:id="language.attributes.overview">
|
||||
@@ -337,12 +337,24 @@ class MyAttribute
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
<classname>MyAttribute</classname> sınıfının başka bir türde bildirilmesi,
|
||||
<function>ReflectionAttribute::newInstance</function> çağrısı sırasında bir
|
||||
istisna oluşmasına sebep olur.
|
||||
<classname>MyAttribute</classname> sınıfının başka bir türde
|
||||
bildirilmesi, <function>ReflectionAttribute::newInstance</function>
|
||||
çağrısı sırasında bir istisna oluşmasına sebep olur.
|
||||
</para>
|
||||
</example>
|
||||
|
||||
<para>Şu hedefler belirtilebilir:</para>
|
||||
|
||||
<simplelist>
|
||||
<member><constant>Attribute::TARGET_CLASS</constant></member>
|
||||
<member><constant>Attribute::TARGET_FUNCTION</constant></member>
|
||||
<member><constant>Attribute::TARGET_METHOD</constant></member>
|
||||
<member><constant>Attribute::TARGET_PROPERTY</constant></member>
|
||||
<member><constant>Attribute::TARGET_CLASS_CONSTANT</constant></member>
|
||||
<member><constant>Attribute::TARGET_PARAMETER</constant></member>
|
||||
<member><constant>Attribute::TARGET_ALL</constant></member>
|
||||
</simplelist>
|
||||
|
||||
<para>
|
||||
Öntanımlı olarak, bir öznitelik her bildirimde yalnızca bir kere
|
||||
kullanılabilir. Özniteliğin bildirimlerde yinelenebilir olması isteniyorsa,
|
||||
|
||||
@@ -7,117 +7,134 @@
|
||||
<?phpdoc print-version-for="enumerations"?>
|
||||
|
||||
<para>
|
||||
Enumerations, or "Enums" allow a developer to define a custom type that is limited to one
|
||||
of a discrete number of possible values. That can be especially helpful when defining a
|
||||
domain model, as it enables "making invalid states unrepresentable."
|
||||
Numaralandırmalar (veya tür adı olarak "enum") tanımlamalarda, olası
|
||||
değer kümelerinden biriyle sınırlanabilen özel bir veri türünü
|
||||
kullanabilmeyi sağlar. Bu, "geçersiz durumların devredışı bırakılmasını"
|
||||
sağladığından, bir etki alanı modeli tanımlarken özellikle yararlı
|
||||
olabilir.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Enums appear in many languages with a variety of different features. In PHP,
|
||||
Enums are a special kind of object. The Enum itself is a class, and its possible
|
||||
cases are all single-instance objects of that class. That means Enum cases are
|
||||
valid objects and may be used anywhere an object may be used, including type checks.
|
||||
Numaralandırmalar çoğu yazılım dilinde çok çeşitli farklı özelliklerle
|
||||
yer almaktadır. PHP'de ise, <literal>enum</literal> özel bir nesne
|
||||
çeşididir. Kendisi bir sınıf olup içeriği kılıflar (case) bu sınıfın tekil
|
||||
olarak örneklenmiş nesneleridir. Yani, bir numaralandırma kılıfı (enum
|
||||
case) geçerli bir nesne olup, tür sınamaları dahil, bir nesnenin
|
||||
kullanılabildiği her yerde kullanılabilir.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The most popular example of enumerations is the built-in boolean type, which is an
|
||||
enumerated type with legal values &true; and &false;.
|
||||
Enums allows developers to define their own arbitrarily robust enumerations.
|
||||
Numaralandırmaların en bilinen örneği, &true; ve &false; değerlerini
|
||||
(ikil) numaralı tür olarak içeren yerleşik mantıksal türdür.
|
||||
Numaralandırmalar geliştiricinin kendi keyfi numaralandırmalarını
|
||||
tanımlayabilmesini sağlar.
|
||||
</para>
|
||||
</sect1>
|
||||
<sect1 xml:id="language.enumerations.basics">
|
||||
<title>Basic enumerations</title>
|
||||
<title>Temel Numaralandırmalar</title>
|
||||
|
||||
<para>
|
||||
Enums are similar to classes, and share the same namespaces as classes, interfaces, and traits.
|
||||
They are also autoloadable the same way. An Enum defines a new type, which has a fixed, limited
|
||||
number of possible legal values.
|
||||
Numaralandırmalar sınıflara benzer ve sınıflar, arayüzler ve niteliklerle
|
||||
aynı isim alanını paylaşır. Ayrıca, aynı yolla otomatik yüklenebilir. Her
|
||||
numaralandırma, sınırlı ve sabit sayıda olası değer içeren yeni bir tür
|
||||
tanımlar.
|
||||
</para>
|
||||
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
enum Suit
|
||||
enum Deste
|
||||
{
|
||||
case Hearts;
|
||||
case Diamonds;
|
||||
case Clubs;
|
||||
case Spades;
|
||||
case Kupalar;
|
||||
case Karolar;
|
||||
case Sinekler;
|
||||
case Maçalar;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
This declaration creates a new enumerated type named <literal>Suit</literal>, which has
|
||||
four and only four legal values: <literal>Suit::Hearts</literal>, <literal>Suit::Diamonds</literal>,
|
||||
<literal>Suit::Clubs</literal>, and <literal>Suit::Spades</literal>. Variables may be assigned
|
||||
to one of those legal values. A function may be type checked against an enumerated type,
|
||||
in which case only values of that type may be passed.
|
||||
Bu bildirim <literal>Deste</literal> adında yalnız ve yalnız dört meşru
|
||||
değer içeren yeni bir numaralı tür oluşturur:
|
||||
<literal>Deste::Kupalar</literal>, <literal>Deste::Karolar</literal>,
|
||||
<literal>Deste::Sinekler</literal> ve <literal>Deste::Maçalar</literal>.
|
||||
Değişkenlere bu dört değerden biri atanabilir. Yalnızca numaralandırılmış
|
||||
türde değerlerin aktarılabileceği bir işlevin türü sadece o
|
||||
numaralandırılmış türe karşı tür denetimine tabi tutulabilir.
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
function pick_a_card(Suit $suit) { ... }
|
||||
$val = Suit::Diamonds;
|
||||
function kart_seç(Deste $deste) { ... }
|
||||
$val = Deste::Karolar;
|
||||
// OK
|
||||
pick_a_card($val);
|
||||
kart_seç($val);
|
||||
// OK
|
||||
pick_a_card(Suit::Clubs);
|
||||
// TypeError: pick_a_card(): Argument #1 ($suit) must be of type Suit, string given
|
||||
pick_a_card('Spades');
|
||||
kart_seç(Deste::Sinekler);
|
||||
// Tür hatası: kart_seç(): Değiştirge #1 ($deste) Deste türünde olmalıyken string türünde
|
||||
kart_seç('Sinekler');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
An Enumeration may have zero or more <literal>case</literal> definitions, with no maximum.
|
||||
A zero-case enum is syntactically valid, if rather useless.
|
||||
Bir numaralandırma sıfır veya daha fazla sayıda <literal>case</literal>
|
||||
tanımı içerebilir ve azami bir sınır yoktur. <literal>case</literal>
|
||||
içermeyen numaralandırmalar sözdizimsel olarak geçerli olsa da
|
||||
yararsızdır.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
By default, cases are not intrinsically backed by a scalar value. That is, <literal>Suit::Hearts</literal>
|
||||
is not equal to <literal>"0"</literal>. Instead, each case is backed by a singleton object of that name. That means that:
|
||||
Öntanımlı olarak, bir <literal>case</literal> özünde bir sayıl değerle
|
||||
desteklenmez. Yani, <literal>Deste::Kupalar</literal> sayıl olarak
|
||||
<literal>"0"</literal> değerine eşit değildir. Bunun yerine, her
|
||||
<literal>case</literal> taşıdığı isimde tekil bir nesneyle desteklenir.
|
||||
Şöyle ki:
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$a = Suit::Spades;
|
||||
$b = Suit::Spades;
|
||||
$a = Deste::Sinekler;
|
||||
$b = Deste::Sinekler;
|
||||
$a === $b; // true
|
||||
$a instanceof Suit; // true
|
||||
$a instanceof Deste; // true
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
It also means that enum values are never <literal><</literal> or <literal>></literal> each other,
|
||||
since those comparisons are not meaningful on objects. Those comparisons will always return
|
||||
false when working with enum values.
|
||||
Bu ayrıca, numaralı değerlerin birbirlerinden büyük veya küçük
|
||||
olamayacağı anlamına da gelir (zaten nesneler arasında böyle bir
|
||||
karşılaştıma anlamsızdır).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This type of case, with no related data, is called a "Pure Case." An Enum that contains
|
||||
only Pure Cases is called a Pure Enum.
|
||||
Bir değer içermeyen <literal>case</literal> türüne "Desteksiz Kılıf"
|
||||
denir. Sadece desteksiz kılıflar içeren numaralandırmalara "Desteksiz
|
||||
Numaralandırma" denir.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
All Pure Cases are implemented as instances of their enum type. The enum type is represented internally as a class.
|
||||
Tüm desteksiz kılıflar içerildikleri numaralandırmayı gerçekleyen
|
||||
örneklerdir. <literal>enum</literal> türü dahili olarak bir sınıfla
|
||||
ifade edilir.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
All Cases have a read-only property, <literal>name</literal>, that is the case-sensitive name
|
||||
of the case itself. That may sometimes be useful for debugging purposes.
|
||||
Tüm kılıflar birer salt-okunur özellik olup <literal>name</literal> harf
|
||||
büyüklüğüne duyarsız olarak kılıfın kendi ismidir. Bu, hata ayıklama
|
||||
amacıyla bazı durumlarda yararlı olabilir.
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
print Suit::Spades->name;
|
||||
// prints "Spades"
|
||||
print Deste::Sinekler->name;
|
||||
// çıktısı: "Sinekler"
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
@@ -125,203 +142,223 @@ print Suit::Spades->name;
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="language.enumerations.backed">
|
||||
<title>Backed enumerations</title>
|
||||
<title>Destekli Numaralandırmalar</title>
|
||||
|
||||
<para>
|
||||
By default, Enumerated Cases have no scalar equivalent. They are simply singleton objects. However,
|
||||
there are ample cases where an Enumerated Case needs to be able to round-trip to a database or
|
||||
similar datastore, so having a built-in scalar (and thus trivially serializable) equivalent defined
|
||||
intrinsically is useful.
|
||||
Öntanımlı olarak numaralı kılıfların sayıl bir karşılığı yoktur. Basitçe
|
||||
tekil nesnelerdir. Bununla birlikte, bir numaralandırılmış kılıfın bir
|
||||
veritabanına veya benzer bir veri deposuna giriş-çıkış yapabilmesini
|
||||
gerektiren çok sayıda durum vardır, dolayısıyla, dahili olarak tanımlanmış
|
||||
yerleşik bir sayıl (ve dolayısıyla dizgeleştirilebilir) eşdeğerin varlığı
|
||||
yararlıdır.
|
||||
</para>
|
||||
|
||||
<para>To define a scalar equivalent for an Enumeration, the syntax is as follows:</para>
|
||||
<para>Bir numaralandırmaya sayıl bir eşdeğer tanımlama sözdizimi:</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
enum Suit: string
|
||||
enum Deste: string
|
||||
{
|
||||
case Hearts = 'H';
|
||||
case Diamonds = 'D';
|
||||
case Clubs = 'C';
|
||||
case Spades = 'S';
|
||||
case Kupalar = 'Ku';
|
||||
case Karolar = 'Ka';
|
||||
case Sinekler = 'S';
|
||||
case Maçalar = 'M';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
A case that has a scalar equivalent is called a Backed Case, as it is "Backed"
|
||||
by a simpler value. An Enum that contains all Backed Cases is called a "Backed Enum."
|
||||
A Backed Enum may contain only Backed Cases. A Pure Enum may contain only Pure Cases.
|
||||
Basitçe bir değerle "destekli" olduğundan sayıl eşdeğeri olan kılıflara
|
||||
"Destekli Kılıf" denir. Yalnızca desteki kılıflar içeren numaralandırmalara
|
||||
"Destekli Numaralandırma" denir. Destekli bir numaralandırma sadece
|
||||
destekli kılıfları içerir, desteksiz kılıf içermez. Desteksiz bir
|
||||
numaralama ise sadece desteksiz kılıfları içerir, destekli kılıf içermez.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A Backed Enum may be backed by types of <literal>int</literal> or <literal>string</literal>,
|
||||
and a given enumeration supports only a single type at a time (that is, no union of <literal>int|string</literal>).
|
||||
If an enumeration is marked as having a scalar equivalent, then all cases must have a unique
|
||||
scalar equivalent defined explicitly. There are no auto-generated scalar equivalents
|
||||
(e.g., sequential integers). Backed cases must be unique; two backed enum cases may
|
||||
not have the same scalar equivalent. However, a constant may refer to a case, effectively
|
||||
creating an alias. See <link linkend="language.enumerations.constants">Enumeration constants</link>.
|
||||
Destekli bir numaralandırma, <literal>int</literal> veya
|
||||
<literal>string</literal> türünde bir değerle ama daima tek bir türdeki
|
||||
değerlerle desteklenebilir (yani ya hepsi <literal>int</literal> ya da
|
||||
hepsi <literal>string</literal> türünde olabilir). Bir numaralandırma sayıl
|
||||
bir eşdeğere sahip olarak imlenmişse, tüm kılıflarına açıkça eşsiz birer
|
||||
değer tanımlanmış olmalıdır. Sayıl eşdeğerler otomatik olarak
|
||||
üretilmeyecektir (örneğin, sıralı tamsayılar). Destekli kılıflar diğer
|
||||
kılıflar arasında eşsiz olmalı, aynı sayıl eşdeğere sahip birden fazla
|
||||
kılıf olmamalıdır. Ancak, bir takma ad oluşturmak amacıyla bir sabite
|
||||
atanabilir. Bkz: <link
|
||||
linkend="language.enumerations.constants">Numaralandırma Sabitleri</link>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Equivalent values must be literals or literal expressions. Constants and constant expressions
|
||||
are not supported. That is, <literal>1 + 1</literal> is allowed, but <literal>1 + SOME_CONST</literal>
|
||||
is not.
|
||||
Sayıl eşdeğerler sayılların kendileri olabileceği gibi sayıl ifadeleri de
|
||||
olabilir. Sabitler ve sabit ifadeleri desteklenmez. Yani,
|
||||
<literal>1 + 1</literal> geçerli, fakat <literal>1 + SOME_CONST</literal>
|
||||
geçersizdir.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Backed Cases have an additional read-only property, <literal>value</literal>, which is the value
|
||||
specified in the definition.
|
||||
Destekli Kılıflar ayrıca salt-okunur özellikler olup,
|
||||
<literal>value</literal> tanımda belirtilen değerdir.
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
print Suit::Clubs->value;
|
||||
// Prints "C"
|
||||
print Deste::Sinekler->value;
|
||||
// Çıktısı: "S"
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
In order to enforce the <literal>value</literal> property as read-only, a variable cannot
|
||||
be assigned as a reference to it. That is, the following throws an error:
|
||||
<literal>value</literal> özelliğinin salt-okunurluğunu zorlamak amacıyla
|
||||
bir değişkene gönderimli atanamaz. Yani, aşağıdaki örnek bir hata üretir:
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$suit = Suit::Clubs;
|
||||
$ref = &$suit->value;
|
||||
// Error: Cannot acquire reference to property Suit::$value
|
||||
$deste = Deste::Sinekler;
|
||||
$ref = &$deste->value;
|
||||
// hata: Deste::$value özelliğine gönderim sağlanamıyor
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
Backed enums implement an internal <interfacename>BackedEnum</interfacename> interface,
|
||||
which exposes two additional methods:
|
||||
Destekli numaralandırmalar dahili olarak iki ek yöntem sağlayan
|
||||
<interfacename>BackedEnum</interfacename> arayüzü ile gerçeklenir:
|
||||
</para>
|
||||
|
||||
<simplelist>
|
||||
<member>
|
||||
<literal>from(int|string): self</literal> will take a scalar and return the corresponding
|
||||
Enum Case. If one is not found, it will throw a <classname>ValueError</classname>. This is mainly
|
||||
useful in cases where the input scalar is trusted and a missing enum value should be
|
||||
considered an application-stopping error.
|
||||
<literal>from(int|string): self</literal> yöntemi bir sayıl değer alır ve
|
||||
karşılığı olan numaralandırma kılıfını döndürür. Böyle bir kılıf yoksa
|
||||
<classname>ValueError</classname> istisnası yavrulanır. Girdi olarak sayıl
|
||||
değere güvenildiği ancak karşılığında bir numaralandırma değerinin
|
||||
olmadığı durumda uygulama durduran bir hata gerekiyorsa yararlı olabilir.
|
||||
</member>
|
||||
<member>
|
||||
<literal>tryFrom(int|string): ?self</literal> will take a scalar and return the
|
||||
corresponding Enum Case. If one is not found, it will return <literal>null</literal>.
|
||||
This is mainly useful in cases where the input scalar is untrusted and the caller wants
|
||||
to implement their own error handling or default-value logic.
|
||||
<literal>tryFrom(int|string): ?self</literal> yöntemi bir sayıl değer alır
|
||||
ve karşılığı olan numaralandırma kılıfını döndürür. Böyle bir kılıf yoksa,
|
||||
yönrem <literal>null</literal> döndürür. Girdi olarak sayıl
|
||||
değere güvenilmediği durumda geliştirici hatayı kendi ele almak isterse
|
||||
veya bir öntanımlama yapmak isterse yararlı olabilir.
|
||||
</member>
|
||||
</simplelist>
|
||||
|
||||
<para>
|
||||
The <literal>from()</literal> and <literal>tryFrom()</literal> methods follow standard
|
||||
weak/strong typing rules. In weak typing mode, passing an integer or string is acceptable
|
||||
and the system will coerce the value accordingly. Passing a float will also work and be
|
||||
coerced. In strict typing mode, passing an integer to <literal>from()</literal> on a
|
||||
string-backed enum (or vice versa) will result in a <classname>TypeError</classname>,
|
||||
as will a float in all circumstances. All other parameter types will throw a TypeError
|
||||
in both modes.
|
||||
<literal>from()</literal> ve <literal>tryFrom()</literal> yöntemleri
|
||||
standart gevşek/katı kodlama kurallarını izler. Gevşek kodlama kipinde, bir
|
||||
tamsayı veya dizge aktarımı kabul edilebilir ve sistem değeri buna göre
|
||||
zorlar. Bir gerçel sayı da çalışır ve bu da zorlanır. Katı kodlama kipinde,
|
||||
bir dizge kılıf değeri durumunda <literal>from()</literal> yöntemine bir
|
||||
tamsayı (veya gerçel sayı) aktarımı (veya tersi)
|
||||
<classname>TypeError</classname> istisnasına yol açar. Her iki kipte, tüm
|
||||
diğer değiştirge türleri <classname>TypeError</classname> istisnasına yol
|
||||
açar.
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$record = get_stuff_from_database($id);
|
||||
print $record['suit'];
|
||||
$suit = Suit::from($record['suit']);
|
||||
// Invalid data throws a ValueError: "X" is not a valid scalar value for enum "Suit"
|
||||
print $suit->value;
|
||||
$suit = Suit::tryFrom('A') ?? Suit::Spades;
|
||||
// Invalid data returns null, so Suit::Spades is used instead.
|
||||
print $suit->value;
|
||||
print $record['deste'];
|
||||
$deste = Deste::from($record['deste']);
|
||||
// Geçersiz veri ValueError yavrulatır: "X" değeri enum "Deste" için geçerli bir sayıl değer değildir
|
||||
print $deste->value;
|
||||
$deste = Deste::tryFrom('A') ?? Deste::Sinekler;
|
||||
// Geçersiz veri null döndürür, yerine Deste::Sinekler kullanılır.
|
||||
print $deste->value;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
<para>Manually defining a <literal>from()</literal> or <literal>tryFrom()</literal> method on a Backed Enum will result in a fatal error.</para>
|
||||
<para>
|
||||
<literal>from()</literal> veya <literal>tryFrom()</literal> yöntemini
|
||||
geliştirici destekli bir numaralandırma üzerinde kendi tanımlarsa sonuç
|
||||
ölümcül hata olur.
|
||||
</para>
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="language.enumerations.methods">
|
||||
<title>Enumeration methods</title>
|
||||
<title>Numaralandırma Yöntemleri</title>
|
||||
|
||||
<para>
|
||||
Enums (both Pure Enums and Backed Enums) may contain methods, and may implement interfaces.
|
||||
If an Enum implements an interface, then any type check for that interface will also accept
|
||||
all cases of that Enum.
|
||||
Numaralandırmalar (destekli ve desteksiz, her ikiside) yöntemler içerebilir
|
||||
ve arayüazleri gerçekleyebilir. Bir numaralandırma, bir arayüzü
|
||||
gerçekliyorsa bu arayüz için her tür sınaması bu numaralandırmanın tüm
|
||||
sınıflarını kabul edecektir.
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
interface Colorful
|
||||
interface Renkli
|
||||
{
|
||||
public function color(): string;
|
||||
public function renk(): string;
|
||||
}
|
||||
enum Suit implements Colorful
|
||||
enum Deste implements Renkli
|
||||
{
|
||||
case Hearts;
|
||||
case Diamonds;
|
||||
case Clubs;
|
||||
case Spades;
|
||||
// Fulfills the interface contract.
|
||||
public function color(): string
|
||||
case Kupalar;
|
||||
case Karolar;
|
||||
case Sinekler;
|
||||
case Maçalar;
|
||||
// Arayüzle anlaşmayı sağlar.
|
||||
public function renk(): string
|
||||
{
|
||||
return match($this) {
|
||||
Suit::Hearts, Suit::Diamonds => 'Red',
|
||||
Suit::Clubs, Suit::Spades => 'Black',
|
||||
Deste::Kupalar, Deste::Karolar => 'Kırmızı',
|
||||
Deste::Sinekler, Deste::Maçalar => 'Siyah',
|
||||
};
|
||||
}
|
||||
// Not part of an interface; that's fine.
|
||||
public function shape(): string
|
||||
// bir arayüzün parçası değil; ama geçerli.
|
||||
public function kesim(): string
|
||||
{
|
||||
return "Rectangle";
|
||||
return "Dörtgen";
|
||||
}
|
||||
}
|
||||
function paint(Colorful $c) { ... }
|
||||
paint(Suit::Clubs); // Works
|
||||
print Suit::Diamonds->shape(); // prints "Rectangle"
|
||||
function boya(Renkli $c) { ... }
|
||||
boya(Deste::Sinekler); // çalışır
|
||||
print Deste::Karolar->kesim(); // "Dörtgen"
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
In this example, all four instances of <literal>Suit</literal> have two methods,
|
||||
<literal>color()</literal> and <literal>shape()</literal>. As far as calling code
|
||||
and type checks are concerned, they behave exactly the same as any other object instance.
|
||||
Bu örnekte, dört <literal>Deste</literal> örneğinin hepsi iki yönteme
|
||||
sahiptir: <literal>renk()</literal> ve <literal>kesim()</literal>. Kod
|
||||
çağrılır çağrılmaz tür sınamaları yapılır. Bu diğer nesne örneklerine
|
||||
uygulanandan farklı değildir.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
On a Backed Enum, the interface declaration goes after the backing type declaration.
|
||||
Destekli numaralamada arayüz bildirimi, desteki tür bildiriminden sonra
|
||||
ele alınır.
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
interface Colorful
|
||||
interface Renkli
|
||||
{
|
||||
public function color(): string;
|
||||
public function renk(): string;
|
||||
}
|
||||
enum Suit: string implements Colorful
|
||||
enum Deste: string implements Renkli
|
||||
{
|
||||
case Hearts = 'H';
|
||||
case Diamonds = 'D';
|
||||
case Clubs = 'C';
|
||||
case Spades = 'S';
|
||||
// Fulfills the interface contract.
|
||||
public function color(): string
|
||||
case Kupalar = 'Ku';
|
||||
case Karolar = 'Ka';
|
||||
case Sinekler = 'S';
|
||||
case Maçalar = 'M';
|
||||
// arayüzle anlaşmayı sağlar
|
||||
public function renk(): string
|
||||
{
|
||||
return match($this) {
|
||||
Suit::Hearts, Suit::Diamonds => 'Red',
|
||||
Suit::Clubs, Suit::Spades => 'Black',
|
||||
Deste::Kupalar, Deste::Karolar => 'Kırmızı',
|
||||
Deste::Sinekler, Deste::Maçalar => 'Siyah',
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -330,55 +367,58 @@ enum Suit: string implements Colorful
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
Inside a method, the <literal>$this</literal> variable is defined and refers to the Case instance.
|
||||
Yöntemin içindeki <literal>$this</literal> değişkeni değer olarak kılıf
|
||||
örneği alır.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Methods may be arbitrarily complex, but in practice will usually return a static value or
|
||||
<link linkend="control-structures.match">match</link> on <literal>$this</literal> to provide
|
||||
different results for different cases.
|
||||
Yöntemler keyfi olarak karmaşık olabilir, ancak uygulamada, farklı
|
||||
durumlara farklı sonuçlar sağlamak için genellikle statik bir değer döner
|
||||
veya <literal>$this</literal> ile
|
||||
<link linkend="control-structures.match">eşleşir</link>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Note that in this case it would be a better data modeling practice to also define a
|
||||
<literal>SuitColor</literal> Enum Type with values Red and Black and return that instead.
|
||||
However, that would complicate this example.
|
||||
Bu durumda, Kırmızı ve Siyah değerleriyle bir RenkliDeste Enum türü
|
||||
tanımlamak ve bunun yerine onu döndürmek daha iyi bir veri modelleme
|
||||
uygulaması olacaktır. Ancak bu, örneği daha da karmaşıklaştıracaktır.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The above hierarchy is logically similar to the following class structure
|
||||
(although this is not the actual code that runs):
|
||||
Yukarıdaki hiyerarşi mantıksal olarak aşağıdaki sınıf yapısına benzer
|
||||
(bu, çalışan asıl kod olmasa da):
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
interface Colorful
|
||||
interface Renkli
|
||||
{
|
||||
public function color(): string;
|
||||
public function renk(): string;
|
||||
}
|
||||
final class Suit implements UnitEnum, Colorful
|
||||
final class Deste implements UnitEnum, Renkli
|
||||
{
|
||||
public const Hearts = new self('Hearts');
|
||||
public const Diamonds = new self('Diamonds');
|
||||
public const Clubs = new self('Clubs');
|
||||
public const Spades = new self('Spades');
|
||||
public const Kupalar = new self('Kupalar');
|
||||
public const Karolar = new self('Karolar');
|
||||
public const Sinekler = new self('Sinekler');
|
||||
public const Maçalar = new self('Maçalar');
|
||||
private function __construct(public readonly string $name) {}
|
||||
public function color(): string
|
||||
public function renk(): string
|
||||
{
|
||||
return match($this) {
|
||||
Suit::Hearts, Suit::Diamonds => 'Red',
|
||||
Suit::Clubs, Suit::Spades => 'Black',
|
||||
Deste::Kupalar, Deste::Karolar => 'Kırmızı',
|
||||
Deste::Sinekler, Deste::Maçalar => 'Siyah',
|
||||
};
|
||||
}
|
||||
public function shape(): string
|
||||
public function kesim(): string
|
||||
{
|
||||
return "Rectangle";
|
||||
return "Dörtgen";
|
||||
}
|
||||
public static function cases(): array
|
||||
{
|
||||
// Illegal method, because manually defining a cases() method on an Enum is disallowed.
|
||||
// See also "Value listing" section.
|
||||
// Geçersiz yöntem
|
||||
// Bir Enum üzerinde cases() yöntemini geliştirici tanımlayamaz.
|
||||
// "Değer listeleme" bölümüne bakınız.
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -386,14 +426,14 @@ final class Suit implements UnitEnum, Colorful
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
Methods may be public, private, or protected, although in practice private and
|
||||
protected are equivalent as inheritance is not allowed.
|
||||
Yöntemler public, private veya protected olabilir, ancak uygulamada
|
||||
private ve protected kalıtıma izin verilmediğinden eşdeğerdir.
|
||||
</para>
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="language.enumerations.static-methods">
|
||||
<title>Enumeration static methods</title>
|
||||
<title>Statik Numaralandırma Yöntemleri</title>
|
||||
|
||||
<para>
|
||||
Enumerations may also have static methods. The use for static methods on the
|
||||
@@ -429,7 +469,7 @@ enum Size
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="language.enumerations.constants">
|
||||
<title>Enumeration constants</title>
|
||||
<title>Numaralandırma Sabitleri</title>
|
||||
|
||||
<para>
|
||||
Enumerations may include constants, which may be public, private, or protected,
|
||||
@@ -454,12 +494,13 @@ enum Size
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="language.enumerations.traits">
|
||||
<title>Traits</title>
|
||||
<title>Nitelikler</title>
|
||||
|
||||
<para>Enumerations may leverage traits, which will behave the same as on classes.
|
||||
The caveat is that traits <literal>use</literal>d in an enum must not contain properties.
|
||||
They may only include methods and static methods. A trait with properties will
|
||||
result in a fatal error.
|
||||
<para>
|
||||
Numaralandırmalar, sınıflardaki gibi davranan niteliklerden yararlanabilir.
|
||||
Ancak, bir numaralandırma içinde kullanılan niteliklerin özelliklerinin
|
||||
olmamasına dikkat edilmelidir. Sadece yöntemler ve statik yöntemler
|
||||
içerebilir. Özellikleri olan bir nitelik ölümcül hata ile sonuçlanır.
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
@@ -496,7 +537,7 @@ enum Suit implements Colorful
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="language.enumerations.expressions">
|
||||
<title>Enum values in constant expressions</title>
|
||||
<title>Sabit ifadelerinde numaralandırma değerleri</title>
|
||||
|
||||
<para>
|
||||
Because cases are represented as constants on the enum itself, they may be used as static
|
||||
@@ -541,94 +582,113 @@ $x = Direction::Up['short'];
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="language.enumerations.object-differences">
|
||||
<title>Differences from objects</title>
|
||||
<title>Nesnelerden farkları</title>
|
||||
|
||||
<para>
|
||||
Although Enums are built on classes and objects, they do not support all object-related functionality.
|
||||
In particular, Enum cases are forbidden from having state.
|
||||
Numaralandırmalar, sınıflar ve nesnelerde yerleşik bulunabilirse de,
|
||||
nesnelerle ilgili işlevselliğin tamamını kullanamaz. Özellikle,
|
||||
numaralandırmalar durumlu olamaz.
|
||||
</para>
|
||||
|
||||
<simplelist>
|
||||
<member>Constructors and Destructors are forbidden.</member>
|
||||
<member>Inheritance is not supported. Enums may not extend or be extended.</member>
|
||||
<member>Static or object properties are not allowed.</member>
|
||||
<member>Cloning an Enum case is not supported, as cases must be singleton instances</member>
|
||||
<member><link linkend="language.oop5.magic">Magic methods</link>, except for those listed below, are disallowed.</member>
|
||||
</simplelist>
|
||||
|
||||
<para>The following object functionality is available, and behaves just as it does on any other object:</para>
|
||||
|
||||
<simplelist>
|
||||
<member>Public, private, and protected methods.</member>
|
||||
<member>Public, private, and protected static methods.</member>
|
||||
<member>Public, private, and protected constants.</member>
|
||||
<member>Enums may implement any number of interfaces.</member>
|
||||
<member>
|
||||
Enums and cases may have <link linkend="language.attributes">attributes</link> attached
|
||||
to them. The <constant>TARGET_CLASS</constant> target
|
||||
filter includes Enums themselves. The <constant>TARGET_CLASS_CONST</constant> target filter
|
||||
includes Enum Cases.
|
||||
</member>
|
||||
<member>
|
||||
<link linkend="object.call">__call</link>, <link linkend="object.callstatic">__callStatic</link>,
|
||||
and <link linkend="object.invoke">__invoke</link> magic methods
|
||||
</member>
|
||||
<member><constant>__CLASS__</constant> and <constant>__FUNCTION__</constant> constants behave as normal</member>
|
||||
<member>Kurucular ve yıkıcılar kullanılamaz.</member>
|
||||
<member>Kalıtım desteklenmez. Numaralandırmalar ne genişletebilir ne de
|
||||
genişletilebilir.</member>
|
||||
<member>Statik ve nesne özelliklere izin verilmez.</member>
|
||||
<member>Bir numaralandırmanın kopyalanması, kılıfların tekil örnekler
|
||||
olması gerektiğinden desteklenmez.</member>
|
||||
<member>Aşağıda sıralananlar dışında kalan
|
||||
<link linkend="language.oop5.magic">Sihirli yöntemlere</link> izin
|
||||
verilmez.</member>
|
||||
</simplelist>
|
||||
|
||||
<para>
|
||||
The <literal>::class</literal> magic constant on an Enum type evaluates to the type
|
||||
name including any namespace, exactly the same as an object. The <literal>::class</literal>
|
||||
magic constant on a Case instance also evaluates to the Enum type, as it is an
|
||||
instance of that type.
|
||||
Aşağıdaki nesne işlevselliği kullanılabilir ve diğer nesnelerdeki
|
||||
davranış elde edilir:
|
||||
</para>
|
||||
|
||||
<simplelist>
|
||||
<member>Public, private ve protected yöntemler.</member>
|
||||
<member>Public, private ve protected static yöntemler.</member>
|
||||
<member>Public, private ve protected sabitler.</member>
|
||||
<member>Numaralandırmalar çok sayıda arayüz gerçekleyebilir.</member>
|
||||
<member>
|
||||
Numaralandırmalar ve kılıfların kendilerine ekli
|
||||
<link linkend="language.attributes">öznitelikleri</link> olabilir.
|
||||
<constant>TARGET_CLASS</constant> hedef süzgeci Numaralandırmaların
|
||||
kendilerini içerir. <constant>TARGET_CLASS_CONST</constant> hedef süzgeci
|
||||
ise Numaralandırma Kılıflarını içerir.
|
||||
</member>
|
||||
<member>
|
||||
<link linkend="object.call">__call</link>,
|
||||
<link linkend="object.callstatic">__callStatic</link>,
|
||||
ve <link linkend="object.invoke">__invoke</link> sihirli yöntemleri
|
||||
</member>
|
||||
<member><constant>__CLASS__</constant> ve <constant>__FUNCTION__</constant>
|
||||
sabitleri normal olarak davranır.</member>
|
||||
</simplelist>
|
||||
|
||||
<para>
|
||||
Bir numaralandırma türündeki <literal>::class</literal> sihirli sabiti,
|
||||
tamamen bir nesnedeki gibi isimalanlı tür adı olarak değerlendirilir. Bir
|
||||
kılıf örneğindeki <literal>::class</literal> sihirli sabiti ise, o türün
|
||||
tekil örneği olduğu için numaralandırma olarak değerlendirilir.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Additionally, enum cases may not be instantiated directly with <literal>new</literal>, nor with
|
||||
<methodname>ReflectionClass::newInstanceWithoutConstructor</methodname> in reflection. Both will result in an error.
|
||||
Ayrıca, numaralandırma kılıfları doğrudan <literal>new</literal> ile
|
||||
örneklenemediği gibi yansıtma içinde
|
||||
<methodname>ReflectionClass::newInstanceWithoutConstructor</methodname> ile
|
||||
de örneklenemez.
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$clovers = new Suit();
|
||||
// Error: Cannot instantiate enum Suit
|
||||
$horseshoes = (new ReflectionClass(Suit::class))->newInstanceWithoutConstructor()
|
||||
// Error: Cannot instantiate enum Suit
|
||||
$trefl = new Suit();
|
||||
// Hata: enum Suit örneklenemez
|
||||
$kör = (new ReflectionClass(Suit::class))->KurucusuzYeniÖrnek()
|
||||
// Hata: enum Suit örneklenemez
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="language.enumerations.listing">
|
||||
<title>Value listing</title>
|
||||
<title>Değer Listeleme</title>
|
||||
|
||||
<para>
|
||||
Both Pure Enums and Backed Enums implement an internal interface named
|
||||
<interfacename>UnitEnum</interfacename>. <literal>UnitEnum</literal> includes a static method
|
||||
<literal>cases()</literal>. <literal>cases()</literal> returns a packed array of
|
||||
all defined Cases in the order of declaration.
|
||||
Saf ve destekli numaralandırmaların her ikisi de
|
||||
<interfacename>UnitEnum</interfacename> adlı dahili bir arayüzü gerçekler.
|
||||
<literal>UnitEnum</literal> arayüzü <literal>cases()</literal> statik
|
||||
yöntemini içerir. <literal>cases()</literal> yöntemi, bildirim sırasında
|
||||
tanımlanmış tüm kılıfları içeren bir dizi döndürür.
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
Suit::cases();
|
||||
// Produces: [Suit::Hearts, Suit::Diamonds, Suit::Clubs, Suit:Spades]
|
||||
// Şunları üretir: [Suit::Hearts, Suit::Diamonds, Suit::Clubs, Suit:Spades]
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
<para>Manually defining a <literal>cases()</literal> method on an Enum will result in a fatal error.</para>
|
||||
<para>
|
||||
Bir numaralandırmada <literal>cases()</literal> yöntemini kendiniz
|
||||
tanımlarsanız ölümcül bir hata alırsınız.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="language.enumerations.serialization">
|
||||
<title>Serialization</title>
|
||||
<title>Dizgeleştirme</title>
|
||||
|
||||
<para>
|
||||
Enumerations are serialized differently from objects. Specifically, they have a new serialization code,
|
||||
<literal>"E"</literal>, that specifies the name of the enum case. The deserialization routine is then
|
||||
able to use that to set a variable to the existing singleton value. That ensures that:
|
||||
Numalandırmaların dizgeleştirmesi nesnelerden farklıdır. Özellikle,
|
||||
kendilerine özgü bir dizgeleştirme kodu olarak numaralandırma kılıfı ismini
|
||||
belirten <literal>"E"</literal> koduna sahiptir. Nesneleştirme sırasında
|
||||
kod bunu mevcut tekil değeri bir değişkene atamakta kullanır. Sonuçta
|
||||
aşağıdaki gibi bir durumun gerçeklenmesi sağlanır:
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
@@ -642,18 +702,21 @@ print serialize(Suit::Hearts);
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
On deserialization, if an enum and case cannot be found to match a serialized
|
||||
value a warning will be issued and <literal>false</literal> returned.</para>
|
||||
|
||||
<para>
|
||||
If a Pure Enum is serialized to JSON, an error will be thrown. If a Backed Enum
|
||||
is serialized to JSON, it will be represented by its value scalar only, in the
|
||||
appropriate type. The behavior of both may be overridden by implementing
|
||||
<classname>JsonSerializable</classname>.
|
||||
Nesneleştirme sırasında bir numaralandırma ve kılıfın eşleşeceği
|
||||
dizgeleştirilmiş bir değer yoksa bir uyarı çıktılanıp
|
||||
<literal>false</literal> döndürülür.
|
||||
</para>
|
||||
|
||||
<para>For <function>print_r</function>, the output of an enum case is slightly different
|
||||
from objects to minimize confusion.
|
||||
<para>
|
||||
Desteksiz bir numaralandırmayı JSON'a dizgeleştirme bir hataya yol açar.
|
||||
Destekli bir numaralandırmayı JSON'a dizgeleştirme ise uygun türdeki sayıl
|
||||
değeri ile gösterilir. Her iki davranış
|
||||
<classname>JsonSerializable</classname> gerçeklenerek geçersiz kılınabilir.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>print_r</function> için, numaralandırma kılıfı çıktısı,
|
||||
karışıklığı azaltmak için nesnelerdekinden oldukça farklıdır.
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
@@ -667,7 +730,7 @@ enum Baz: int {
|
||||
}
|
||||
print_r(Foo::Bar);
|
||||
print_r(Baz::Beep);
|
||||
/* Produces
|
||||
/* Çıktısı:
|
||||
Foo Enum (
|
||||
[name] => Bar
|
||||
)
|
||||
@@ -686,24 +749,25 @@ Baz Enum:int {
|
||||
|
||||
<para>
|
||||
<example>
|
||||
<title>Basic limited values</title>
|
||||
<title>- Basit sınırlı değerler</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
enum SortOrder
|
||||
enum Sırala
|
||||
{
|
||||
case ASC;
|
||||
case DESC;
|
||||
case ART;
|
||||
case AZAL;
|
||||
}
|
||||
function query($fields, $filter, SortOrder $order = SortOrder::ASC) { ... }
|
||||
function sorgu($alanlar, $süzgeç, Sırala $sırala = Sırala::ART) { ... }
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
The <literal>query()</literal> function can now proceed safe in the knowledge that
|
||||
<literal>$order</literal> is guaranteed to be either <literal>SortOrder::ASC</literal>
|
||||
or <literal>SortOrder::DESC</literal>. Any other value would have resulted in a
|
||||
<classname>TypeError</classname>, so no further error checking or testing is needed.
|
||||
<literal>sorgu()</literal> işlevi, $sırala'nın Sırala::ART veya
|
||||
Sırala::AZAL olduğunun garanti edildiği bilgisiyle artık güvenli bir
|
||||
şekilde ilerleyebilir. Başka herhangi bir değer
|
||||
<classname>TypeError</classname> ile sonuçlanırdı, bu nedenle daha fazla
|
||||
hata denetimi veya sınaması yapmak gerekmez.
|
||||
</para>
|
||||
</example>
|
||||
</para>
|
||||
@@ -711,24 +775,24 @@ function query($fields, $filter, SortOrder $order = SortOrder::ASC) { ... }
|
||||
<para>
|
||||
|
||||
<example>
|
||||
<title>Advanced exclusive values</title>
|
||||
<title>- Daha ileri özel değerler</title>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
enum UserStatus: string
|
||||
{
|
||||
case Pending = 'P';
|
||||
case Active = 'A';
|
||||
case Suspended = 'S';
|
||||
case CanceledByUser = 'C';
|
||||
public function label(): string
|
||||
case Pending = 'B';
|
||||
case Active = 'E';
|
||||
case Suspended = 'A';
|
||||
case CanceledByUser = 'V';
|
||||
public function yafta(): string
|
||||
{
|
||||
return match($this) {
|
||||
static::Pending => 'Pending',
|
||||
static::Active => 'Active',
|
||||
static::Suspended => 'Suspended',
|
||||
static::CanceledByUser => 'Canceled by user',
|
||||
static::Pending => 'Beklemede',
|
||||
static::Active => 'Etkin',
|
||||
static::Suspended => 'Askıda',
|
||||
static::CanceledByUser => 'Kullanıcı Vazgeçti',
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -737,23 +801,27 @@ enum UserStatus: string
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
In this example, a user's status may be one of, and exclusively, <literal>UserStatus::Pending</literal>,
|
||||
<literal>UserStatus::Active</literal>, <literal>UserStatus::Suspended</literal>, or
|
||||
<literal>UserStatus::CanceledByUser</literal>. A function can type a parameter against
|
||||
<literal>UserStatus</literal> and then only accept those four values, period.
|
||||
Bu örnekte kullanıcının durumu, özellikle şu durumlardan biri olabilir:
|
||||
<literal>UserStatus::Pending</literal>,
|
||||
<literal>UserStatus::Active</literal>,
|
||||
<literal>UserStatus::Suspended</literal> veya
|
||||
<literal>UserStatus::CanceledByUser</literal>.
|
||||
<literal>UserStatus</literal> türünde değiştirge içeren bir işlev sadece
|
||||
bu dört değerden birini kabul edebilir.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
All four values have a <literal>label()</literal> method, which returns a human-readable string.
|
||||
That string is independent of the "machine name" scalar equivalent string, which can be used in,
|
||||
for example, a database field or an HTML select box.
|
||||
Dört değer için, insan okuyabilir dizge döndüren
|
||||
<literal>yafta()</literal> yöntemi kullanılmıştır. Bu dizge,
|
||||
bir veritabanı alanında veya HTML seçim kutusunda kullanılabilen
|
||||
"makine adı" sayıl eşdeğeri olan dizgeden farklı ve bağımsızdır.
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
foreach (UserStatus::cases() as $case) {
|
||||
printf('<option value="%s">%s</option>\n', $case->value, $case->label());
|
||||
printf('<option value="%s">%s</option>\n', $case->value, $case->yafta());
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 6970f8fa7b14b019d0d33ebe1d6ab85cabeb3072 Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 1f7a0e4af85d1b74595626afa1ca774c896e8388 Maintainer: nilgun Status: ready -->
|
||||
<sect1 xml:id="language.errors.php7" xmlns="http://docbook.org/ns/docbook">
|
||||
<title>PHP 7'de hatalar</title>
|
||||
|
||||
@@ -71,6 +70,9 @@
|
||||
<listitem>
|
||||
<simpara><classname>UnhandledMatchError</classname></simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><classname>FiberError</classname></simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
<listitem>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 6970f8fa7b14b019d0d33ebe1d6ab85cabeb3072 Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 1f7a0e4af85d1b74595626afa1ca774c896e8388 Maintainer: nilgun Status: ready -->
|
||||
<!-- CREDITS: haluk -->
|
||||
<part xml:id="reserved.exceptions" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Öntanımlı İstisnalar</title>
|
||||
@@ -26,7 +25,7 @@
|
||||
&language.predefined.typeerror;
|
||||
&language.predefined.valueerror;
|
||||
&language.predefined.unhandledmatcherror;
|
||||
|
||||
&language.predefined.fibererror;
|
||||
</part>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 9fe810352095922a68ce2807745a9bc35c0afe1f Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 1f7a0e4af85d1b74595626afa1ca774c896e8388 Maintainer: nilgun Status: ready -->
|
||||
<!-- CREDITS: haluk -->
|
||||
<part xml:id="reserved.interfaces" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Öntanımlı Arayüzler ve Sınıflar</title>
|
||||
@@ -19,6 +19,7 @@
|
||||
&language.predefined.serializable;
|
||||
&language.predefined.closure;
|
||||
&language.predefined.generator;
|
||||
&language.predefined.fiber;
|
||||
&language.predefined.weakreference;
|
||||
&language.predefined.weakmap;
|
||||
&language.predefined.stringable;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 8cdc6621f9826d04abc3e50438c010804d7e8683 Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 0a192fcd9cc43c0007de795063b4494974058992 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id="function.current" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>current</refname>
|
||||
@@ -43,6 +43,23 @@
|
||||
&return.falseproblem;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
&standard.changelog.calling-on-objects;
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: cd943f94a013b74df8765ab8e1a620a916a64a85 Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 0a192fcd9cc43c0007de795063b4494974058992 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id="function.end" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>end</refname>
|
||||
<refpurpose>Bir dizinin dahili göstericisini sonuncu elemana konumlandırır
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
@@ -18,6 +18,7 @@
|
||||
göstericisini son elemana kadar ilerletir ve bu elemanın değerini döndürür.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
@@ -35,12 +36,31 @@
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Dizi boşsa &false; yoksa son elemanın değeri.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
&standard.changelog.calling-on-objects;
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
@@ -59,6 +79,7 @@ echo end($meyveler); // iğde
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
@@ -72,6 +93,7 @@ echo end($meyveler); // iğde
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 76c26359d5e1293e4b0ca030dcb7fbec7f5b21cc Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 0a192fcd9cc43c0007de795063b4494974058992 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id="function.key" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>key</refname>
|
||||
@@ -42,6 +42,23 @@
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
&standard.changelog.calling-on-objects;
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: cd943f94a013b74df8765ab8e1a620a916a64a85 Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 0a192fcd9cc43c0007de795063b4494974058992 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id="function.next" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>next</refname>
|
||||
@@ -46,6 +45,23 @@
|
||||
&return.falseproblem;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
&standard.changelog.calling-on-objects;
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: cd943f94a013b74df8765ab8e1a620a916a64a85 Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 0a192fcd9cc43c0007de795063b4494974058992 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id="function.prev" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>prev</refname>
|
||||
<refpurpose>Dahili dizi göstericisini bir geriletir</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
@@ -21,6 +21,7 @@
|
||||
</para>
|
||||
&return.falseproblem;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
@@ -36,6 +37,7 @@
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
@@ -43,6 +45,24 @@
|
||||
o elemanın değeri döner, yoksa &false; döner.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
&standard.changelog.calling-on-objects;
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
@@ -63,6 +83,7 @@ $kip = end($araç); // $kip = 'uçak';
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
<note>
|
||||
@@ -74,6 +95,7 @@ $kip = end($araç); // $kip = 'uçak';
|
||||
</simpara>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
@@ -86,6 +108,7 @@ $kip = end($araç); // $kip = 'uçak';
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: cd943f94a013b74df8765ab8e1a620a916a64a85 Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 0a192fcd9cc43c0007de795063b4494974058992 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id="function.reset" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>reset</refname>
|
||||
<refpurpose>Bir dizinin dahili göstericisini ilk elemana konumlar
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
@@ -20,6 +20,7 @@
|
||||
</para>
|
||||
&return.falseproblem;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
@@ -35,12 +36,31 @@
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Dizi boşsa &false;, değilse dizinin ilk elemanının değeri.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
&standard.changelog.calling-on-objects;
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
@@ -70,6 +90,7 @@ echo current($dizi) . "\n"; // "bir adım"
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
<note>
|
||||
@@ -83,6 +104,7 @@ echo current($dizi) . "\n"; // "bir adım"
|
||||
</simpara>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
@@ -96,6 +118,7 @@ echo current($dizi) . "\n"; // "bir adım"
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: bd8169a9b15cfa5007f060532c76d5f766cd4adf Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 766f190db356d7013c802389a8a0ef929f1f1db8 Maintainer: nilgun Status: ready -->
|
||||
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="class.dotnet">
|
||||
<titleabbrev>dotnet</titleabbrev>
|
||||
<title>dotnet sınıfı</title>
|
||||
@@ -15,7 +15,9 @@
|
||||
</para>
|
||||
<para>
|
||||
Statik sınıfların örneklenmesi veya statik yöntemlerin çağrılması
|
||||
desteklenmemektedir.
|
||||
desteklenmediği gibi
|
||||
<literal>System.Collections.Generic.List</literal> gibi soysal
|
||||
sınıfların örneklenmesi de desteklenmemektedir.
|
||||
</para>
|
||||
<para>
|
||||
Bazı .Net sınıfları IDispatch'i gerçeklemediğinden örneklenebilseler bile
|
||||
@@ -30,10 +32,13 @@
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
.Net framework 4.0 ve sonraki sürümleri, <classname>dotnet</classname>
|
||||
sınıfı tarafından desteklenmez. Derlemeler <command>regasm.exe</command>
|
||||
ile kaydedilmişse, sınıflar <classname>com</classname> nesneleri olarak
|
||||
örneklenebilir.
|
||||
PHP 8.0.0 öncesinde, .Net framework 4.0 ve sonraki sürümleri,
|
||||
<classname>dotnet</classname> sınıfı tarafından desteklenmezdi.
|
||||
Derlemeler <command>regasm.exe</command> ile kaydedilmişse, sınıflar
|
||||
<classname>com</classname> nesneleri olarak örneklenebiliyordu.
|
||||
PHP 8.0.0 itibariyle, .Net framework 4.0 ve sonraki sürümleri,
|
||||
<link linkend="ini.com.dotnet-version">com.dotnet_version</link>
|
||||
&php.ini; yönergesi üzerinden desteklenmektedir.
|
||||
</para>
|
||||
</note>
|
||||
</section>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 3e15d2894fb35432d2a111db36fe8ba8ebc62024 Maintainer: nilgun Status: ready -->
|
||||
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.8 -->
|
||||
<!-- EN-Revision: 60c391265d2a51003e1ed0952e5a2413f81c7fc2 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id="function.escapeshellarg" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>escapeshellarg</refname>
|
||||
@@ -28,6 +26,8 @@
|
||||
Windows'ta <function>escapeshellarg</function> bunun yerine yüzde
|
||||
imlerini, ünlem imlerini (gecikmiş değişken ikamesi) ve çift tırnakları
|
||||
boşluklarla değiştirir ve dizeyi çift tırnaklarla sarmalar.
|
||||
Ayrıca, her ardışık tersbölüler dizesi (<literal>\</literal>) bir tersbölü
|
||||
ile öncelenir.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: e41806c30bf6975e452c0d4ce35ab0984c2fa68c Maintainer: nilgun Status: ready -->
|
||||
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.28 -->
|
||||
<!-- EN-Revision: c1f8c2ea33c70f59557175e1a43af7153b1df565 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id='function.proc-open' xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>proc_open</refname>
|
||||
@@ -87,7 +85,8 @@
|
||||
türler: <literal>pipe</literal> (ikinci eleman sürece okuma ucunu
|
||||
aktaran <literal>r</literal> veya yazma ucunu aktaran
|
||||
<literal>w</literal> olabilir) ve <literal>file</literal> (ikinci
|
||||
eleman bir dosya ismidir).
|
||||
eleman bir dosya ismidir). <literal>w</literal> dışındaki herşeyin
|
||||
<literal>r</literal> gibi ele alınacağına dikkat edilmelidir.
|
||||
</member>
|
||||
<member>
|
||||
Gerçek bir dosya tanıtıcısına karşılık gelen bir akım özkaynağı
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<!-- EN-Revision: 28efc4fb2949e32aa90782534acaa282a6d26b29 Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: f8718da894c5160e571d74774c083090569ecebd Maintainer: nilgun Status: ready -->
|
||||
<reference xml:id="ref.pdo-pgsql" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<?phpdoc extension-membership="bundledexternal" ?>
|
||||
<title>PostgreSQL (PDO_PGSQL) İşlevleri</title>
|
||||
@@ -24,6 +24,7 @@
|
||||
</section>
|
||||
|
||||
&reference.pdo-pgsql.configure;
|
||||
&reference.pdo-pgsql.constants;
|
||||
|
||||
<section xml:id="pdo-pgsql.general-notes">
|
||||
<title>Genel bilgiler</title>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 9fe810352095922a68ce2807745a9bc35c0afe1f Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 1f7a0e4af85d1b74595626afa1ca774c896e8388 Maintainer: nilgun Status: ready -->
|
||||
<book xml:id="book.reflection" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<?phpdoc extension-membership="core" ?>
|
||||
<title>Yansıtma</title>
|
||||
@@ -45,6 +45,7 @@
|
||||
&reference.reflection.reflectiontype;
|
||||
&reference.reflection.reflectionuniontype;
|
||||
&reference.reflection.reflectiongenerator;
|
||||
&reference.reflection.reflectionfiber;
|
||||
&reference.reflection.reflectionintersectiontype;
|
||||
&reference.reflection.reflectionreference;
|
||||
&reference.reflection.reflectionattribute;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: b5ac8ca1e844138feb22b62feee67e2618a4696f Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 49eff29e8e235e07b3f6ec7abd9f55ac286f4330 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id="reflectionextension.clone" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ReflectionExtension::__clone</refname>
|
||||
@@ -9,7 +9,8 @@
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>private</modifier> <type>void</type><methodname>ReflectionExtension::__clone</methodname>
|
||||
<modifier>private</modifier>
|
||||
<type>void</type><methodname>ReflectionExtension::__clone</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
@@ -29,6 +30,28 @@
|
||||
</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.1.0</entry>
|
||||
<entry>
|
||||
Bu yöntem artık <modifier>final</modifier> değil.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: af4410a7e15898c3dbe83d6ea38246745ed9c6fb Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 49eff29e8e235e07b3f6ec7abd9f55ac286f4330 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id="reflectionfunctionabstract.clone" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ReflectionFunctionAbstract::__clone</refname>
|
||||
@@ -10,7 +9,8 @@
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>private</modifier> <type>void</type><methodname>ReflectionFunctionAbstract::__clone</methodname>
|
||||
<modifier>private</modifier>
|
||||
<type>void</type><methodname>ReflectionFunctionAbstract::__clone</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
@@ -33,6 +33,28 @@
|
||||
</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.1.0</entry>
|
||||
<entry>
|
||||
Bu yöntem artık <modifier>final</modifier> değil.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: af4410a7e15898c3dbe83d6ea38246745ed9c6fb Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 49eff29e8e235e07b3f6ec7abd9f55ac286f4330 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id="reflectionparameter.clone" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ReflectionParameter::__clone</refname>
|
||||
@@ -10,7 +9,8 @@
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>private</modifier> <type>void</type><methodname>ReflectionParameter::__clone</methodname>
|
||||
<modifier>private</modifier>
|
||||
<type>void</type><methodname>ReflectionParameter::__clone</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
@@ -33,6 +33,28 @@
|
||||
</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.1.0</entry>
|
||||
<entry>
|
||||
Bu yöntem artık <modifier>final</modifier> değil.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: af4410a7e15898c3dbe83d6ea38246745ed9c6fb Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: 49eff29e8e235e07b3f6ec7abd9f55ac286f4330 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id="reflectionproperty.clone" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ReflectionProperty::__clone</refname>
|
||||
@@ -10,7 +9,8 @@
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>private</modifier> <type>void</type><methodname>ReflectionProperty::__clone</methodname>
|
||||
<modifier>private</modifier>
|
||||
<type>void</type><methodname>ReflectionProperty::__clone</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
@@ -33,6 +33,28 @@
|
||||
</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.1.0</entry>
|
||||
<entry>
|
||||
Bu yöntem artık <modifier>final</modifier> değil.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: b0c0d6bcd9b7e5889b1ba0746f16ea25a7f3260b Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: a324fcef8023bbb570603185dd097be366fd398d Maintainer: nilgun Status: ready -->
|
||||
<phpdoc:classref xml:id="class.reflectiontype" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>ReflectionType sınıfı</title>
|
||||
@@ -19,6 +19,8 @@
|
||||
(PHP 7.1.0 ve sonrası)</member>
|
||||
<member><classname>ReflectionUnionType</classname>
|
||||
(PHP 8.0.0 ve sonrası)</member>
|
||||
<member><classname>ReflectionIntersectionType</classname>
|
||||
(PHP 8.1.0 ve sonrası)</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: d6cd01d707f065e852e9495061da6b923d7f3422 Maintainer: nilgun Status: ready -->
|
||||
<!-- EN-Revision: ff054fcb4e0c795093255f1e71be2cae68fc6284 Maintainer: nilgun Status: ready -->
|
||||
<refentry xml:id="function.is-numeric" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>is_numeric</refname>
|
||||
@@ -73,9 +73,9 @@ $tests = Array(
|
||||
foreach($tests as $element)
|
||||
{
|
||||
if(is_numeric($element)) {
|
||||
echo var_export($element, true), " sayısaldır", PHP_EOL;
|
||||
echo var_export($element, true), " sayısal", PHP_EOL;
|
||||
} else {
|
||||
echo var_export($element, true), " sayısal DEĞİLdir", PHP_EOL;
|
||||
echo var_export($element, true), " sayısal DEĞİL", PHP_EOL;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -84,26 +84,93 @@ foreach($tests as $element)
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
'42' sayısaldır
|
||||
1337 sayısaldır
|
||||
1337 sayısaldır
|
||||
1337 sayısaldır
|
||||
1337 sayısaldır
|
||||
1337.0 sayısaldır
|
||||
'0x539' sayısal DEĞİLdir
|
||||
'02471' sayısaldır
|
||||
'0b10100111001' sayısal DEĞİLdir
|
||||
'1337e0' sayısaldır
|
||||
'sayısal değil' sayısal DEĞİLdir
|
||||
'42' sayısal
|
||||
1337 sayısal
|
||||
1337 sayısal
|
||||
1337 sayısal
|
||||
1337 sayısal
|
||||
1337.0 sayısal
|
||||
'0x539' sayısal DEĞİL
|
||||
'02471' sayısal
|
||||
'0b10100111001' sayısal DEĞİL
|
||||
'1337e0' sayısal
|
||||
'sayısal değil' sayısal DEĞİL
|
||||
array (
|
||||
) sayısal DEĞİLdir
|
||||
9.1 sayısaldır
|
||||
NULL sayısal DEĞİLdir
|
||||
'' sayısal DEĞİLdir
|
||||
) sayısal DEĞİL
|
||||
9.1 sayısal
|
||||
NULL sayısal DEĞİL
|
||||
'' sayısal DEĞİL
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<example>
|
||||
<title>- Boşluk karakterli <function>is_numeric</function> örneği</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$tests = [
|
||||
" 42",
|
||||
"42 ",
|
||||
" 9001", // yapışkan boşluk
|
||||
"9001 ", // yapışkan boşluk
|
||||
];
|
||||
|
||||
foreach ($tests as $element) {
|
||||
if (is_numeric($element)) {
|
||||
echo var_export($element, true) . " sayısal", PHP_EOL;
|
||||
} else {
|
||||
echo var_export($element, true) . " sayısal DEĞİL", PHP_EOL;
|
||||
}
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.8;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
' 42' sayısal
|
||||
'42 ' sayısal
|
||||
' 9001' sayısal DEĞİL
|
||||
'9001 ' sayısal DEĞİL
|
||||
]]>
|
||||
</screen>
|
||||
&example.outputs.7;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
' 42' sayısal
|
||||
'42 ' sayısal DEĞİL
|
||||
' 9001' sayısal DEĞİL
|
||||
'9001 ' sayısal DEĞİL
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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.0.0</entry>
|
||||
<entry>
|
||||
Boşlukla biten sayısal dizgeler (<literal>"42 "</literal>) için artık
|
||||
&true; dönüyor. Evvelce, &false; dönerdi.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
|
||||
Reference in New Issue
Block a user