You can use OutputDebugString to write messages to the Log panel:
$v = 1234;
OutputDebugString('v = ' . $v); |
If you right-click the Log panel, you can
Filter messages to include for example just ODS, so you only see OutputDebugString messages. You can then also tick the Log panel to
Auto Activate which means PhpED will automatically display the panel every time you get a debug string.
Bear in mind OutputDebugString() is not a standard PHP statement, so if you accidentally release a site to production and it contains that statement, it will probably fail to run. For that reason some developers are of the belief that you should not use special debug statements (DebugBreak, OutputDebugString, etc.) whilst testing.
You could define your own OutputDebugString() stub function to allow running in a non-debug environment without having to change your code:
if (! function_exists('OutputDebugString')) {
function OutputDebugString($string) {
}
} |