1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-24 07:42:22 +01:00
Files
archived-doc-ru/reference/com/functions/variant-cmp.xml
Sergey Panteleev 6d43fd64d7 Исправление форматирования
[skip-spellcheck]
[skip-lint]
2022-12-27 03:42:36 +03:00

168 lines
5.4 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 20216b916ed583938672cd09c2c2f430351430d1 Maintainer: rjhdby Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.variant-cmp" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>variant_cmp</refname>
<refpurpose>Сравнить два варианта</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>variant_cmp</methodname>
<methodparam><type>mixed</type><parameter>left</parameter></methodparam>
<methodparam><type>mixed</type><parameter>right</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>locale_id</parameter><initializer><constant>LOCALE_SYSTEM_DEFAULT</constant></initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
Сравнивает <parameter>left</parameter> с <parameter>right</parameter>.
</para>
<para>
Функция сравнивает только скалярные величины. Массивы и записи вариантов не сравнивает.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>left</parameter></term>
<listitem>
<para>
Левый операнд.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>right</parameter></term>
<listitem>
<para>
Правый операнд.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>locale_id</parameter></term>
<listitem>
<para>
Корректный идентификатор локали, используемый при сравнении строк (влияет на
сортировку строк).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>
<parameter>flags</parameter> - побитовое ИЛИ следующих значений (либо просто
одно из них):
<table>
<title>Флаги сравнения вариантов</title>
<tgroup cols="2">
<thead>
<row>
<entry>значение</entry>
<entry>описание</entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>NORM_IGNORECASE</constant></entry>
<entry>Сравнивать регистронезависимо</entry>
</row>
<row>
<entry><constant>NORM_IGNORENONSPACE</constant></entry>
<entry>Игнорировать символы не занимающие места</entry>
</row>
<row>
<entry><constant>NORM_IGNORESYMBOLS</constant></entry>
<entry>Игнорировать символы</entry>
</row>
<row>
<entry><constant>NORM_IGNOREWIDTH</constant></entry>
<entry>Игнорировать длину строки</entry>
</row>
<row>
<entry><constant>NORM_IGNOREKANATYPE</constant></entry>
<entry>Игнорировать тип Кана</entry>
</row>
<row>
<entry><constant>NORM_IGNOREKASHIDA</constant></entry>
<entry>Игнорировать символы Кашиды для Арабского языка</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
&com.variant-arith;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает одно из:
<table>
<title>Результаты сравнения вариантов</title>
<tgroup cols="2">
<thead>
<row>
<entry>значение</entry>
<entry>описание</entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>VARCMP_LT</constant></entry>
<entry><parameter>left</parameter> меньше чем
<parameter>right</parameter>
</entry>
</row>
<row>
<entry><constant>VARCMP_EQ</constant></entry>
<entry><parameter>left</parameter> идентичен
<parameter>right</parameter>
</entry>
</row>
<row>
<entry><constant>VARCMP_GT</constant></entry>
<entry><parameter>left</parameter> больше чем
<parameter>right</parameter>
</entry>
</row>
<row>
<entry><constant>VARCMP_NULL</constant></entry>
<entry>Оба значения <parameter>left</parameter> и
<parameter>right</parameter> равны &null;
</entry>
</row>
</tbody>
</tgroup>
</table>
</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
-->