$var = 'hello'; eZDebug::writeWarning('The value of $var is ' . $var);
try { // Some code that might throw an exception } catch (Exception $e) { eZDebug::writeError($e->getMessage()); }
$start = microtime(true); // Some code to be profiled $end = microtime(true); $time = $end - $start; eZDebug::writeDebug('Execution time: ' . $time);This example measures the execution time of a block of code and logs it as a debug message. In conclusion, eZDebug is a powerful debugging tool that comes bundled with the eZ Components library. It offers a range of features and functions that can help developers during the development phase of their PHP applications.