mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 16:32:13 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@154802 c90b9560-bf6c-de11-be94-00142212c4b1
183 lines
4.7 KiB
XML
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ó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ó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ón</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>function</entry>
|
|
<entry><type>string</type></entry>
|
|
<entry>
|
|
El nombre de la función actual. Vea 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. Vea tambié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é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é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étodo, se devuelve "->". Si es una llamada a un
|
|
método estático, se devuelve "::". Si es una
|
|
llamada de funció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ón, contiene
|
|
una lista de los argumentos de la función. Si se
|
|
encuentra al interior de un archivo de inclusión,
|
|
contiene una lista de los nombres de archivos
|
|
incluí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é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
|
|
-->
|