Doc #63282 [NEW]: Documented value for SplFileObject::SKIP_EMPTY does not match real value

From: Date: Mon, 15 Oct 2012 20:00:25 +0000
Subject: Doc #63282 [NEW]: Documented value for SplFileObject::SKIP_EMPTY does not match real value
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8965@lists.php.net to get a copy of this message
From: jsmith at jssm dot com Operating system: Windows PHP version: 5.3.17 Package: SPL related Bug Type: Documentation Problem Bug description:Documented value for SplFileObject::SKIP_EMPTY does not match real value Description: ------------ The class synopsis for SplFileObject (http://www.php.net/manual/en/class.splfileobject.php#splfileobject.synopsis) indicates that the SKIP_EMPTY constant is defined with the value of 6. I have included a PHPUnit test case showing that the SKIP_EMPTY constant does not match the value listed in the documentation. The value of the SplFileObject::SKIP_EMPTY constant changed in PHP 5.3.8 from 6 to 4 (https://bugs.php.net/bug.php?id=55807) and the problem still remains. It was noticed and a new bug report was opened for the problem it caused (https://bugs.php.net/bug.php?id=61032). Ideally, the constant should be restored to its old value of 6. Another acceptable choice is to update the documentation so that the constant is accurately documented in addition to adding a note to the SKIP_EMPTY constant indicating that it requires the READ_AHEAD flag to also be set in order to function. Test script: --------------- class SplFileObjectTest extends PHPUnit_Framework_TestCase { public function testConstants() { // constants taken from http://www.php.net/manual/en/class.splfileobject.php#splfileobject.synopsis $this->assertEquals(1, SplFileObject::DROP_NEW_LINE); $this->assertEquals(2, SplFileObject::READ_AHEAD); $this->assertEquals(6, SplFileObject::SKIP_EMPTY); // <- THIS ONE FAILS $this->assertEquals(8, SplFileObject::READ_CSV); } } Expected result: ---------------- Ideally, all the assertions pass. Actual result: -------------- PHPUnit_Framework_ExpectationFailedException : Failed asserting that 4 matches expected 6. Expected :6 Actual :4 -- Edit bug report at https://bugs.php.net/bug.php?id=63282&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63282&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63282&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63282&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63282&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63282&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63282&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63282&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63282&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=63282&r=support Expected behavior: https://bugs.php.net/fix.php?id=63282&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63282&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63282&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63282&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63282&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63282&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63282&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=63282&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63282&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63282&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63282&r=mysqlcfg

« previous php.doc.bugs (#8965) next »