From: [EMAIL PROTECTED]
Operating system: linux
PHP version: 4.2.2
PHP Bug Type: Filesystem function related
Bug description: exec() vs file() with newlines
This is just basically an inconsistency between file() and exec()
file() will return the newline on the end of each element in the array,
ie:
$data = file("somefile.txt");
$data[0][ strlen($data[0])-1 ] == "\n"
but exec() doesn't put newlines on it's output:
exec("soemthing", $data);
$data[0][ strlen($data[0])-1 ] != "\n"
At the least, the manual page for file() and/or exec() should state this
behaviour.
--
Edit bug report at http://bugs.php.net/?id=20905&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20905&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20905&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20905&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20905&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20905&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20905&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20905&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20905&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20905&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20905&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20905&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20905&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20905&r=isapi