Bug #15200: file() function sometimes adds slashes before single and double quotes

From: Date: Thu, 24 Jan 2002 11:01:06 +0000
Subject: Bug #15200: file() function sometimes adds slashes before single and double quotes
Groups: php.dev 
Request: Send a blank email to php-dev+get-77980@lists.php.net to get a copy of this message
From:             phasme@cicv.fr
Operating system: Linux 2.4 Mandrake 8
PHP version:      4.0.6
PHP Bug Type:     Filesystem function related
Bug description:  file() function sometimes adds slashes before single and double quotes

this bug (?) is difficult to encircle and reproduce (and understand),
because it appears in a very erratic way.

from time to time, when a file is read with file() and its content
displayed line by line with each(), all its single and double quotes are
automatically backslashed !
example :
with 'toto.txt' contains :  je n'aime pas ce "bug" !
and the following script :
<?php
  $my_file = file('toto.txt');
  while(list(, $my_line) = each($my_file)) {
    echo $my_line;
  }
?>

**sometimes** we get something like :
  je n\'aime pas ce \"bug\" !

(and sometimes not...)

?!?!

- our system :
  Linux 2.4 (Mdk 8)
  Apache 1.3.22
  PHP 4.0.6 (RPM Mdk)


-- 
Edit bug report at: http://bugs.php.net/?id=15200&edit=1



Thread (6 messages)

« previous php.dev (#77980) next »