|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-06-12 20:05 UTC] philip@php.net
[2003-06-12 20:42 UTC] philip@php.net
[2003-06-13 00:17 UTC] torben@php.net
[2003-06-22 20:10 UTC] philip@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 12:00:02 2025 UTC |
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.