#36087 [NEW]: file() cannot read rule with <?
| From: | bob at xbob dot nl | Date: | Thu, 19 Jan 2006 15:00:23 +0000 |
| Subject: | #36087 [NEW]: file() cannot read rule with <? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-92214@lists.php.net to get a copy of this message | ||
From: bob at xbob dot nl
Operating system: linux
PHP version: 5.1.2
PHP Bug Type: Filesystem function related
Bug description: file() cannot read rule with <?
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 bug report at http://bugs.php.net/?id=36087&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36087&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36087&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36087&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36087&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36087&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36087&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36087&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36087&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36087&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36087&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36087&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36087&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36087&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36087&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36087&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36087&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36087&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36087&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36087&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36087&r=mysqlcfg