When using Aptana with PHP 5.2.3 in debug mode (using thread safe XDebug 2.1.0 for PHP 5.2 VC6) to run a simple multi-line hello world script I get some erratic behaviour on the Aptana 'Console' tab.
I've a hello_world.php script that contains the following:
<?php
$stdout = fopen('php://stdout', 'w');
fwrite($stdout, 'Hello world!');
fwrite($stdout, 'Hello world!2');
fwrite($stdout, 'Hello world!3');
fclose($stdout);
?>
My PHP debug configuration in Aptana is using php.exe from the c:\wamp\php folder, in CLI mode with XDebug as the debugger.
If I start a debug session and let my code execute straight through, I get the expected output (as I do if I run this from a command prompt).
If I step through the code however, I only see the first line ("Hello world!") in the "Console" section of Aptana. In fact, I can avoid even seeing the first "Hello world!" by stepping quickly from the fopen() line to the first fwrite() line. If I pause for perhaps 3 to 5 seconds after stepping through the fopen(), and then run the fwrite, I will get the first "Hello world!".
Needless to say, this is completely baffling. Please let me know if you'd like more information about my configuration, and I'll be glad to provide it!
Cheers! Duncan
(I'm actually attempting to debug a CakePHP shell script that uses fwrite to stdout instead of echo... but I want to solve this problem first!)