php調試器 xdebug
xdebug是一個開源的php調試器,以php模塊的形式加載并被使用。
Xdebug的基本功能包括堆棧跟蹤顯示錯誤,最大嵌套級別的保護,并及時跟蹤。 項目主頁:http://www.baiduhome.net/lib/view/home/1322626929671 This function returns the name of the class from which the current function/method was called from. This function returns the filename that contains the function/method that called the current function/method. For an example see xdebug_call_class(). This function returns the name of the function/method from which the current function/method was called from. For an example see xdebug_call_class(). This function returns the line number that contains the function/method that called the current function/method. For an example see xdebug_call_class(). Disable showing stack traces on error conditions. Enable showing stack traces on error conditions. This function returns all errors from the collection buffer that contains all errors that were stored there when error collection was started with xdebug_start_error_collection(). By default this function will not clear the error collection buffer. If you pass true as argument to this function then the buffer will be cleared as well. This function returns a string containing all collected errors formatted as an "Xdebug table". Returns all the headers that are set with PHP's header() function, or any other header set internally within PHP (such as through setcookie()), as an array. Return whether stack traces would be shown in case of an error or not. Returns the current amount of memory the script uses. Before PHP 5.2.1, this only works if PHP is compiled with --enable-memory-limit. From PHP 5.2.1 and later this function is always available. Returns the maximum amount of memory the script used until now. Before PHP 5.2.1, this only works if PHP is compiled with --enable-memory-limit. From PHP 5.2.1 and later this function is always available. When this function is executed, Xdebug will cause PHP not to display any notices, warnings or errors. Instead, they are formatted according to Xdebug's normal error formatting rules (ie, the error table with the red exclamation mark) and then stored in a buffer. This will continue until you call xdebug_stop_error_collection(). This buffer's contents can be retrieved by calling xdebug_get_collected_errors() and then subsequently displayed. This is really useful if you want to prevent Xdebug's powerful error reporting features from destroying your layout. When this function is executed, error collection as started by xdebug_start_error_collection() is aborted. The errors stored in the collection buffer are not deleted and still available to be fetched through xdebug_get_collected_errors(). Returns the current time index since the starting of the script in seconds.
Related Settings
Related Functions
<?php
function fix_string($a)
{
echo "Called @ ".
xdebug_call_file().
":".
xdebug_call_line().
" from ".
xdebug_call_function();
}
$ret = fix_string(array('Derick'));
?>
Called @ /home/httpd/html/test/xdebug_caller.php:12 from {main}
<?php
header( "X-Test", "Testing" );
setcookie( "TestCookie", "test-value" );
var_dump( xdebug_get_headers() );
?>
array(2) {
[0]=>
string(6) "X-Test"
[1]=>
string(33) "Set-Cookie: TestCookie=test-value"
}
<?php
echo xdebug_time_index(), "\n";
for ($i = 0; $i < 250000; $i++)
{
// do nothing
}
echo xdebug_time_index(), "\n";
?>
0.00038003921508789
0.76580691337585
相關資訊