#45216 [NEW]: SplFileObject::fgetss is not mapped correctly
| From: | perrick at noparking dot net | Date: | Mon, 09 Jun 2008 15:52:53 +0000 |
| Subject: | #45216 [NEW]: SplFileObject::fgetss is not mapped correctly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-125607@lists.php.net to get a copy of this message | ||
From: perrick at noparking dot net
Operating system: mac os x
PHP version: 5.3CVS-2008-06-09 (snap)
PHP Bug Type: SPL related
Bug description: SplFileObject::fgetss is not mapped correctly
Description:
------------
SplFileObject::fgetss($allowable_tags = NULL) doesn't work at all.
The underlying fgetss that's called in the object needs a length :
"string fgetss ( resource $handle [, int $length [, string $allowable_tags
]] )"
A test is available on testfest.php.net :
http://testfest.php.net/index.php?do=details&task_id=126
Reproduce code:
---------------
$file = dirname(__FILE__) . '/foo.html';
file_put_contents($file, 'text 0<div class="tested">text 1</div>');
$handle = fopen($file, 'r');
$object = new SplFileObject($file);
var_dump($object->fgetss());
var_dump(fgetss($handle));
Expected result:
----------------
string(12) "text 0text 1"
string(12) "text 0text 1"
Actual result:
--------------
Warning: fgetss(): Length parameter must be greater than 0 in
/Users/perrick/Desktop/testfest/spl_fileobject_fgetss_basic.php on line 7
string(12) "text 0text 1"
--
Edit bug report at http://bugs.php.net/?id=45216&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45216&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45216&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45216&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45216&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45216&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45216&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45216&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45216&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45216&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45216&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45216&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45216&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45216&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45216&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45216&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45216&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45216&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45216&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45216&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45216&r=mysqlcfg