ID: 24787
User updated by: per dot funke at ub dot oru dot se
Reported By: per dot funke at ub dot oru dot se
Status: Bogus
Bug Type: Output Control
Operating System: Linux
PHP Version: 4.3.2
New Comment:
Thanks for your prompt attention. I'm sorry to say that I can't
reproduce the error either. It has gone away after using up the better
part of my working hours before lunch. I'm really sorry to have been
using up your valuable time and I will now go and hit myself hard on
the head w. a hammer (after having a look at the cli documentation
though, it's new to me..). Humbly your's Per F.
Previous Comments:
------------------------------------------------------------------------
[2003-07-24 06:14:22] [EMAIL PROTECTED]
You're either doing something wrong, or you have some weird
php.ini options set. Try error_reporting(E_ALL); as first line in your
script. Also, ditch the hashbang line (#!..) and run the script with
CLI: # sapi/cli/php -n test.php
------------------------------------------------------------------------
[2003-07-24 03:18:54] [EMAIL PROTECTED]
with PHP 4.3.2 cli my output with the last_read 2 echo is:
Import started. Infile is
test.txt
last_read 1 123
last_read 2 123
like it should be....
------------------------------------------------------------------------
[2003-07-24 02:45:04] per dot funke at ub dot oru dot se
there is a line missing from the submitted code:
the line should read:
echo "\nlast_read 2 ".$last_read;
and should be inserted immediately after the line
echo "\nlast_read 1 ".$last_read;
(Sorry...)
------------------------------------------------------------------------
[2003-07-24 02:40:48] per dot funke at ub dot oru dot se
Description:
------------
In script run from the shell, only one out of
two echo-statements results in a printed line.
Reproduce code:
---------------
#!/usr/local/php/bin/php
<?php
//#################################################################
echo "\nImport started. Infile is
/usr/local/apache/htdocs/nweb/stdweb/vis/out.skv";
$a_compiled_collection[0]="";
//$fp2 =
fopen("/usr/local/apache/htdocs/nweb/stdweb/vis/out.skv","r");
$fp3 =
fopen("/usr/local/apache/htdocs/nweb/stdweb/vis/imported_lines","r");
$last_read=fgets ($fp3);
$done=fclose($fp3);
echo "\nlast_read 1 ".$last_read;
//fclose($fp2);
exit;
//#################################################################
?>
Expected result:
----------------
$ ./test.php
Import started. Infile is
/usr/local/apache/htdocs/nweb/stdweb/vis/out.skv
last_read 1 500
last_read 2 500
$
Actual result:
--------------
$ ./test.php
Import started. Infile is
/usr/local/apache/htdocs/nweb/stdweb/vis/out.skv
last_read 1 500
$
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24787&edit=1