-
Notifications
You must be signed in to change notification settings - Fork 17
[uk] Український переклад: language/types/type-system #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
serhiilabs
wants to merge
4
commits into
php:master
Choose a base branch
from
serhiilabs:uk-type-system-translation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,273 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- EN-Revision: f908fff129bcd8ec1605658e06457cb04e5b2b51 Maintainer: web-svb Status: wip --> | ||
| <sect1 xml:id="language.types.type-system"> | ||
| <title>Система типів</title> | ||
|
|
||
| <para> | ||
| PHP використовує номінальну систему типів із чітким поведінковим підтипізуванням. | ||
| Відношення підтипів перевіряється під час компіляції, | ||
| тоді як перевірка типів здійснюється динамічно під час виконання. | ||
| </para> | ||
|
|
||
| <para> | ||
| Система типів PHP підтримує різні атомарні типи, | ||
| які можна комбінувати для створення складніших. | ||
| Деякі з цих типів можна використовувати в | ||
| <link linkend="language.types.declarations">оголошеннях типів</link>. | ||
| </para> | ||
|
|
||
| <sect2 xml:id="language.types.type-system.atomic"> | ||
| <title>Атомарні типи</title> | ||
| <para> | ||
| Деякі атомарні типи є вбудованими й тісно інтегровані з мовою, | ||
| тому їх неможливо відтворити за допомогою користувацьких типів. | ||
| </para> | ||
|
|
||
| <para> | ||
| Перелік базових типів: | ||
| <itemizedlist> | ||
| <listitem> | ||
| <simpara>Вбудовані типи</simpara> | ||
| <itemizedlist> | ||
| <listitem> | ||
| <simpara> | ||
| Скалярні типи: | ||
| </simpara> | ||
| <itemizedlist> | ||
| <listitem> | ||
| <simpara> | ||
| тип | ||
| <type>bool</type> | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| тип | ||
| <type>int</type> | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| тип | ||
| <type>float</type> | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| тип | ||
| <type>string</type> | ||
| </simpara> | ||
| </listitem> | ||
| </itemizedlist> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| тип | ||
| <type>array</type> | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| тип | ||
| <type>object</type> | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| тип | ||
| <type>resource</type> | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| тип | ||
| <type>never</type> | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| тип | ||
| <type>void</type> | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| <link linkend="language.types.relative-class-types">Відносні типи класів</link>: | ||
| <type>self</type>, <type>parent</type>, та | ||
| <type>static</type> | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| <link linkend="language.types.singleton">Одиничні типи</link> | ||
| </simpara> | ||
| <itemizedlist> | ||
| <listitem> | ||
| <simpara> | ||
| <type>false</type> | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| <type>true</type> | ||
| </simpara> | ||
| </listitem> | ||
| </itemizedlist> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| Об'єднання типів | ||
| </simpara> | ||
| <itemizedlist> | ||
| <listitem> | ||
| <simpara> | ||
| <type>null</type> | ||
| </simpara> | ||
| </listitem> | ||
| </itemizedlist> | ||
| </listitem> | ||
| </itemizedlist> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| Користувацькі типи (часто називають класовими типами) | ||
| </simpara> | ||
| <itemizedlist> | ||
| <listitem> | ||
| <simpara> | ||
| <link linkend="language.oop5.interfaces">Інтерфейси</link> | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| <link linkend="language.oop5.basic.class">Класи</link> | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| <link linkend="language.types.enumerations">Перерахування</link> | ||
| </simpara> | ||
| </listitem> | ||
| </itemizedlist> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| тип | ||
| <type>callable</type> | ||
| </simpara> | ||
| </listitem> | ||
| </itemizedlist> | ||
| </para> | ||
|
|
||
| <sect3 xml:id="language.types.type-system.atomic.scalar"> | ||
| <title>Скалярні типи</title> | ||
| <simpara> | ||
| Значення вважається скалярним, якщо воно має тип <type>int</type>, | ||
| <type>float</type>, <type>string</type> or <type>bool</type>. | ||
|
serhiilabs marked this conversation as resolved.
Outdated
|
||
| </simpara> | ||
| </sect3> | ||
|
|
||
| <sect3 xml:id="language.types.type-system.atomic.user-defined"> | ||
| <title>Користувацькі типи</title> | ||
| <simpara> | ||
| Можна визначати власні типи за допомогою | ||
| <link linkend="language.oop5.interfaces">інтерфейсів</link>, | ||
| <link linkend="language.oop5.basic.class">класів</link> | ||
| та | ||
| <link linkend="language.types.enumerations">перерахувань</link>. | ||
| Вони вважаються користувацькими типами, або класовими типами. | ||
| Наприклад, можна визначити клас із назвою <literal>Elephant</literal>, | ||
| створити об’єкти цього типу, | ||
| а також оголосити функцію, яка приймає параметр типу <literal>Elephant</literal>. | ||
| </simpara> | ||
| </sect3> | ||
| </sect2> | ||
|
|
||
| <sect2 xml:id="language.types.type-system.composite"> | ||
| <title>Складені типи</title> | ||
| <para> | ||
| Можна поєднувати кілька атомарних типів у складені. | ||
| PHP дозволяє комбінувати типи такими способами: | ||
| </para> | ||
|
|
||
| <itemizedlist> | ||
| <listitem> | ||
| <simpara> | ||
| Перетин класових типів (інтерфейсів і назв класів). | ||
| </simpara> | ||
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| Об'єднання типів. | ||
| </simpara> | ||
| </listitem> | ||
| </itemizedlist> | ||
|
|
||
| <sect3 xml:id="language.types.type-system.composite.intersection"> | ||
| <title>Перетин типів</title> | ||
| <para> | ||
| Перетин типів приймає значення, які відповідають не одному, | ||
| а одночасно кільком класовим типам. | ||
| Окремі типи, що утворюють перетин, об’єднуються за допомогою символу <literal>&</literal>. | ||
| Тому перетину типів <literal>T</literal>, <literal>U</literal> та | ||
|
serhiilabs marked this conversation as resolved.
Outdated
|
||
| <literal>V</literal> | ||
| записується як <literal>T&U&V</literal>. | ||
| </para> | ||
| </sect3> | ||
|
|
||
| <sect3 xml:id="language.types.type-system.composite.union"> | ||
| <title>Об'єднання типів</title> | ||
| <para> | ||
| Тип об'єднання приймає значення кількох різних типів, | ||
| а не лише одного. | ||
| Окремі типи, що утворюють об'єднання, поєднуються за допомогою символу | ||
| <literal>|</literal>. | ||
| Отже, тип об'єднання з типів <literal>T</literal>, <literal>U</literal> і | ||
| <literal>V</literal> | ||
| записується як <literal>T|U|V</literal>. | ||
| Якщо одним із компонентів є тип перетину, його беруть у дужки, | ||
| щоб записати у диз'юнктивній нормальній формі <acronym>DNF</acronym>: | ||
| <literal>T|(X&Y)</literal>. | ||
| </para> | ||
| </sect3> | ||
| </sect2> | ||
|
|
||
| <sect2 xml:id="language.types.type-system.alias"> | ||
| <title>Псевдоніми типів</title> | ||
|
|
||
| <para> | ||
| PHP підтримує два псевдоніми типів: <type>mixed</type> та | ||
| <type>iterable</type>, які відповідають (у тому ж порядку) | ||
| <link linkend="language.types.type-system.composite.union">об'єднанню типів</link> | ||
| <literal>object|resource|array|string|float|int|bool|null</literal> | ||
| і <literal>Traversable|array</literal>. | ||
| </para> | ||
|
|
||
| <note> | ||
| <simpara> | ||
| PHP не підтримує користувацькі псевдоніми типів. | ||
| </simpara> | ||
| </note> | ||
| </sect2> | ||
|
|
||
| </sect1> | ||
| <!-- 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 | ||
| --> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.