#47307 [NEW]: Very wrong info in documentation

From: Date: Wed, 04 Feb 2009 16:58:27 +0000
Subject: #47307 [NEW]: Very wrong info in documentation
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1799@lists.php.net to get a copy of this message
From:             saskia at sa5kia dot nl
Operating system: NetBSD
PHP version:      Irrelevant
PHP Bug Type:     Documentation problem
Bug description:  Very wrong info in documentation

Description:
------------
The information on the file_exists() function on
http://nl2.php.net/file_exists is very wrong. I spend
an hour to find out
what the problem of my script was, but your manual was the one that was
wrong. It sais the function gives a TRUE or a FALSE as an output, but this
is very incorrect. It outputs 1 or 0. This is absolutely not the same on
unix systems. TRUE or FALSE are boolean values, integers 1 or 0 are used
for this a lot, but are INTEGERS. "If" statements in php will NOT recognize
the boolean and will not function correctly when treated as one.

Please just say a function outputs 0 or 1, if it outputs 0 or 1.

Reproduce code:
---------------
$does_the_file_exist = "yes";

if ( ! file_exists( "some_not_an_existing_file" ) )
{
    $does_the_file_exist = "no"
}


Expected result:
----------------
The value of $does_the_file_exist is "yes", but it should be "no".


-- 
Edit bug report at http://bugs.php.net/?id=47307&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        http://bugs.php.net/fix.php?id=47307&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        http://bugs.php.net/fix.php?id=47307&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        http://bugs.php.net/fix.php?id=47307&r=trysnapshot60
Fixed in CVS:                        http://bugs.php.net/fix.php?id=47307&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47307&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=47307&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=47307&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=47307&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=47307&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=47307&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=47307&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=47307&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=47307&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=47307&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47307&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47307&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=47307&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=47307&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=47307&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=47307&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=47307&r=mysqlcfg



Thread (2 messages)

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