1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-26 16:32:13 +01:00
Files
archived-doc-es/reference/errorfunc/functions/debug-backtrace.xml
Leonardo Boshell 28eef7beac Actualizaciones y correcciones
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@154802 c90b9560-bf6c-de11-be94-00142212c4b1
2004-03-28 22:37:50 +00:00

183 lines
4.7 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- EN-Revision: 1.12 Maintainer: lboshell Status: ready -->
<refentry id="function.debug-backtrace">
<refnamediv>
<refname>debug_backtrace</refname>
<refpurpose>
Genera un backtrace
</refpurpose>
</refnamediv>
<refsect1>
<title>Descripci&oacute;n</title>
<methodsynopsis>
<type>array</type><methodname>debug_backtrace</methodname>
<void/>
</methodsynopsis>
<para>
<function>debug_backtrace</function> genera un backtrace PHP y
devuelve esta informaci&oacute;n como un <type>array</type>
asociativo. Los elementos posiblemente devueltos son
referenciados en la siguiente tabla:
</para>
<para>
<table>
<title>Elementos posiblemente devueltos
por <function>debug_backtrace</function></title>
<tgroup cols="3">
<thead>
<row>
<entry>Nombre</entry>
<entry>Tipo</entry>
<entry>Descripci&oacute;n</entry>
</row>
</thead>
<tbody>
<row>
<entry>function</entry>
<entry><type>string</type></entry>
<entry>
El nombre de la funci&oacute;n actual. Vea tambi&eacute;n
<link
linkend="language.constants.predefined">__FUNCTION__</link>.
</entry>
</row>
<row>
<entry>line</entry>
<entry><type>integer</type></entry>
<entry>
El n&uacute;mero de l&iacute;nea actual. Vea tambi&eacute;n
<link
linkend="language.constants.predefined">__LINE__</link>.
</entry>
</row>
<row>
<entry>file</entry>
<entry><type>string</type></entry>
<entry>
El nombre del archivo actual. Vea tambi&eacute;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.oop">clase</link>
actual. Vea tambi&eacute;n <link
linkend="language.constants.predefined">__CLASS__</link>
</entry>
</row>
<row>
<entry>type</entry>
<entry><type>string</type></entry>
<entry>
El tipo de llamada actual. Si es una llamada de
m&eacute;todo, se devuelve "->". Si es una llamada a un
m&eacute;todo est&aacute;tico, se devuelve "::". Si es una
llamada de funci&oacute;n, no se devuelve nada.
</entry>
</row>
<row>
<entry>args</entry>
<entry><type>array</type></entry>
<entry>
Si se encuentra al interior de una funci&oacute;n, contiene
una lista de los argumentos de la funci&oacute;n. Si se
encuentra al interior de un archivo de inclusi&oacute;n,
contiene una lista de los nombres de archivos
inclu&iacute;dos.
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
El siguiente es un ejemplo sencillo.
</para>
<para>
<example>
<title>
Ejemplo de <function>debug_backtrace</function>
</title>
<programlisting role="php">
<![CDATA[
<?php
// nombre de archivo: a.php
function una_prueba($cadena)
{
echo "\nHola: $cadena";
var_dump(debug_backtrace());
}
una_prueba('amigo');
?>
<?php
// nombre de archivo: b.php
include_once '/tmp/a.php';
?>
]]>
</programlisting>
<para>
Resultados de ejecutar <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(8) "prueba_a"
["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>
<para>
Vea tambi&eacute;n <function>trigger_error</function> y
<function>debug_print_backtrace</function>.
</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:"../../../../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
-->