#36087 [Opn->Bgs]: file() cannot read rule with <?
| From: | tony2001@php.net | Date: | Thu, 19 Jan 2006 15:09:29 +0000 |
| Subject: | #36087 [Opn->Bgs]: file() cannot read rule with <? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-92216@lists.php.net to get a copy of this message | ||
ID: 36087
Updated by: tony2001@php.net
Reported By: bob at xbob dot nl
-Status: Open
+Status: Bogus
Bug Type: Filesystem function related
Operating System: linux
PHP Version: 5.1.2
New Comment:
Use "View source" to see what your script *really* produces.
Previous Comments:
------------------------------------------------------------------------
[2006-01-19 16:00:23] bob at xbob dot nl
Description:
------------
when file() is reading a rule with '<?' in it, it will fail.
the next rule is in place of the '<?' rule and index key remains. The
next rule's index is copmletly gone. see code example for more
information.
Reproduce code:
---------------
--- file 1 --- class.A.php --- file to read ---
<?php
class A {
protected $var;
}
?>
--- file 2 --- run.php --- file to run ---
<?php
echo '<pre>';
var_dump(file('class.A.php'));
echo '</pre>';
?>
Expected result:
----------------
array(5) {
[0]=>
string(3) "<?
"
[1]=>
string(10) "class A {
"
[2]=>
string(16) "protected $var;
"
[3]=>
string(2) "}
"
[4]=>
string(2) "?>"
}
Actual result:
--------------
array(5) {
[0]=>
string(6) "
string(10) "class A {
"
[2]=>
string(16) "protected $var;
"
[3]=>
string(2) "}
"
[4]=>
string(2) "?>"
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36087&edit=1