1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-28 17:32:16 +01:00
Files
archived-doc-es/reference/errorfunc/functions/debug-backtrace.xml
Pedro Antonio Gil Rodríguez 7faff7e346 Finalizado /reference/errorfunc/*
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@302896 c90b9560-bf6c-de11-be94-00142212c4b1
2010-08-30 16:57:06 +00:00

237 lines
6.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 291313 $ -->
<!-- EN-Revision: 201dc3748c7a94e788d470c697f017d2149c6736 Maintainer: seros Status: ready -->
<refentry xml:id="function.debug-backtrace" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>debug_backtrace</refname>
<refpurpose>Genera un rastreo</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>debug_backtrace</methodname>
<methodparam choice="opt"><type>bool</type><parameter>provide_object</parameter><initializer>true</initializer></methodparam>
</methodsynopsis>
<para>
<function>debug_backtrace</function> genera un rastreo de PHP.
</para>
</refsect1>
<refsect1 role="parameters"><!-- {{{ -->
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>provide_object</parameter></term>
<listitem>
<para>
Si rellenar o no el índice "object".
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1><!-- }}} -->
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Devuelve un <type>array</type> asociativo. Los posibles elementos devueltos
son los siguientes:
</para>
<para>
<table>
<title>Posibles elementos devueltos por <function>debug_backtrace</function></title>
<tgroup cols="3">
<thead>
<row>
<entry>&Name;</entry>
<entry>&Type;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>function</entry>
<entry><type>string</type></entry>
<entry>
El nombre de la función actual. Véase también
<link linkend="language.constants.predefined">__FUNCTION__</link>.
</entry>
</row>
<row>
<entry>line</entry>
<entry><type>integer</type></entry>
<entry>
El número de línea actual. Véase también
<link linkend="language.constants.predefined">__LINE__</link>.
</entry>
</row>
<row>
<entry>file</entry>
<entry><type>string</type></entry>
<entry>
El nombre de archivo actual. Véase también
<link linkend="language.constants.predefined">__FILE__</link>.
</entry>
</row>
<row>
<entry>class</entry>
<entry><type>string</type></entry>
<entry>
El nombre de la <link linkend="language.oop5">clase</link> actual. Véase también
<link linkend="language.constants.predefined">__CLASS__</link>
</entry>
</row>
<row>
<entry>object</entry>
<entry><type>object</type></entry>
<entry>
El <link linkend="language.oop5">objeto</link> actual.
</entry>
</row>
<row>
<entry>type</entry>
<entry><type>string</type></entry>
<entry>
El tipo de llamada actual. Si es una llamada a un método devuelve "->". Si es una llamada
a un método estático devuelve "::". Si es una llamada a una función no se devuelve nada.
</entry>
</row>
<row>
<entry>args</entry>
<entry><type>array</type></entry>
<entry>
Dentro de una función se lista los argumentos de la función.
Dentro de un archvo incluido se lista el nombre (o nombres) del archivo incluido.
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.2.5</entry>
<entry>
Se añadió el parámetro opcional <parameter>provide_object</parameter>.
</entry>
</row>
<row>
<entry>5.1.1</entry>
<entry>
Se añadió el <type>object</type> actual como posible elemento devuelto.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Ejemplo de <function>debug_backtrace</function></title>
<programlisting role="php">
<![CDATA[
<?php
// nombre de archvio: /tmp/a.php
function una_prueba($str)
{
echo "\nHola: $str";
var_dump(debug_backtrace());
}
una_prueba('amigo');
?>
<?php
// nombre de archvio: /tmp/b.php
include_once '/tmp/a.php';
?>
]]>
</programlisting>
<para>
El resultado es similar al siguiente cuando se ejecuta
<filename>/tmp/b.php</filename>:
</para>
<screen>
<![CDATA[
Hola: amigo
array(2) {
[0]=>
array(4) {
["file"] => string(10) "/tmp/a.php"
["line"] => int(10)
["function"] => string(10) "una_prueba"
["args"]=>
array(1) {
[0] => &string(5) "amigo"
}
}
[1]=>
array(4) {
["file"] => string(10) "/tmp/b.php"
["line"] => int(2)
["args"] =>
array(1) {
[0] => string(10) "/tmp/a.php"
}
["function"] => string(12) "include_once"
}
}
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>trigger_error</function></member>
<member><function>debug_print_backtrace</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->