php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #17389 max_upload_filesize setting format is problematic
Submitted: 2002-05-23 10:07 UTC Modified: 2002-11-30 00:48 UTC
From: sean at digitalspinner dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.2.1 OS: Linux
Private report: No CVE-ID: None
 [2002-05-23 10:07 UTC] sean at digitalspinner dot com
The documentation states that max_upload_filesize is an 
integer, although the result from ini_get is "2M". This is 
problematic for the following reasons: 
 
1. With the documentation stating the format as an 
integer, code can be written to output BAD code such as: 
 
$my_value = 2M; 
 
I fell into this trap and didn't locate the problem easily 
because my test installations (unfortunately) stated the 
max_upload_filesize as a true integer inside php.ini.  
 
2. It is not clear how PHP handles the output of GOOD code 
like: 
 
$my_value = "2M"; 
 
If I later have code like: 
 
if ($my_value > $this_value) 
// i.e., if ("2M" > "345") 
 
Will it break? Will "2M" be considered an integer and 
converted automatically to 2097152? If this is the case 
then it is not immediately evident inside of the 
documentation. 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-30 20:18 UTC] sniper@php.net
reclassified
 [2002-11-30 00:48 UTC] pollita@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

Also including comments re: boolean values.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 21:01:33 2025 UTC