mirror of
https://github.com/php/doc-ru.git
synced 2026-03-25 16:22:18 +01:00
172 lines
4.1 KiB
XML
172 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- EN-Revision: ec2fe9a592f794978114ef5021db9f1d00c2e05d Maintainer: rjhdby Status: ready -->
|
||
<!-- Reviewed: no -->
|
||
<refentry xml:id="reflectiongenerator.gettrace" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||
<refnamediv>
|
||
<refname>ReflectionGenerator::getTrace</refname>
|
||
<refpurpose>Получает трассировку запущенного генератора</refpurpose>
|
||
</refnamediv>
|
||
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis role="ReflectionGenerator">
|
||
<modifier>public</modifier> <type>array</type><methodname>ReflectionGenerator::getTrace</methodname>
|
||
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer><constant>DEBUG_BACKTRACE_PROVIDE_OBJECT</constant></initializer></methodparam>
|
||
</methodsynopsis>
|
||
<para>
|
||
Метод получает трассировку работающего генератора.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
<para>
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><parameter>options</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Значение параметра <parameter>options</parameter> устанавливают следующие флаги:
|
||
</para>
|
||
<para>
|
||
<table>
|
||
<title>Доступные опции</title>
|
||
<tgroup cols="2">
|
||
<thead>
|
||
<row>
|
||
<entry>Опция</entry>
|
||
<entry>Описание</entry>
|
||
</row>
|
||
</thead>
|
||
<tbody>
|
||
<row>
|
||
<entry>
|
||
<constant>DEBUG_BACKTRACE_PROVIDE_OBJECT</constant>
|
||
</entry>
|
||
<entry>
|
||
По умолчанию.
|
||
</entry>
|
||
</row>
|
||
<row>
|
||
<entry>
|
||
<constant>DEBUG_BACKTRACE_IGNORE_ARGS</constant>
|
||
</entry>
|
||
<entry>
|
||
Не включать информацию об аргументах функций в стек вызовов.
|
||
</entry>
|
||
</row>
|
||
</tbody>
|
||
</tgroup>
|
||
</table>
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
Метод возвращает трассировку работающего генератора.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="examples">
|
||
&reftitle.examples;
|
||
<para>
|
||
<example>
|
||
<title>Пример использования метода <methodname>ReflectionGenerator::getTrace</methodname></title>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
|
||
function foo() {
|
||
yield 1;
|
||
}
|
||
|
||
function bar()
|
||
{
|
||
yield from foo();
|
||
}
|
||
|
||
function baz()
|
||
{
|
||
yield from bar();
|
||
}
|
||
|
||
$gen = baz();
|
||
$gen->valid(); // Запускаем генератор
|
||
|
||
var_dump((new ReflectionGenerator($gen))->getTrace());
|
||
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
&example.outputs.similar;
|
||
<screen>
|
||
<![CDATA[
|
||
array(2) {
|
||
[0]=>
|
||
array(4) {
|
||
["file"]=>
|
||
string(18) "example.php"
|
||
["line"]=>
|
||
int(8)
|
||
["function"]=>
|
||
string(3) "foo"
|
||
["args"]=>
|
||
array(0) {
|
||
}
|
||
}
|
||
[1]=>
|
||
array(4) {
|
||
["file"]=>
|
||
string(18) "example.php"
|
||
["line"]=>
|
||
int(12)
|
||
["function"]=>
|
||
string(3) "bar"
|
||
["args"]=>
|
||
array(0) {
|
||
}
|
||
}
|
||
}
|
||
]]>
|
||
</screen>
|
||
</example>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="seealso">
|
||
&reftitle.seealso;
|
||
<para>
|
||
<simplelist>
|
||
<member><methodname>ReflectionGenerator::getFunction</methodname></member>
|
||
<member><methodname>ReflectionGenerator::getThis</methodname></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
|
||
-->
|