ID:               24162
 Updated by:       [EMAIL PROTECTED]
 Reported By:      marcus at gooseflesh dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Documentation problem
 Operating System: Windows 2000
 PHP Version:      4.3.2
 New Comment:

It returns bool and is documented as such, thanks for the report.


Previous Comments:
------------------------------------------------------------------------

[2003-06-12 17:32:58] marcus at gooseflesh dot de

Description:
------------
Hello folks,

Of some reasons the return value of ftruncate($handle, $size) is of
type int not of type bool. 

Is there a general reason that the half of the file functions return
true and false as int and the other half true and false as bool ???

Marcus Wilhelm

PHP is the best :))

Reproduce code:
---------------
$handle = fopen("existing.file", "r+");

$return = ftruncate($handle, 17);

if ( $return === true ) // does not match
{
    echo "truncate ok, return value is bool"; 
}
if ( $return == true ) // does match
{
    echo "truncate ok, return value is bool or int"; 
}
if ( $return == 1 ) // does match
{
    echo "truncate ok, return value is int"; 
}

Expected result:
----------------
the return value of ftruncate should be of type bool not of type int.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24162&edit=1


-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to