php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68292 shorthand notation can be used in ini_set
Submitted: 2014-10-23 15:23 UTC Modified: 2015-12-21 14:43 UTC
From: humbads at alum dot mit dot edu Assigned: tpunt (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: n/a
Private report: No CVE-ID: None
 [2014-10-23 15:23 UTC] humbads at alum dot mit dot edu
Description:
------------
In the PHP FAQ #16 for shorthand notation, it says:

"You may not use these shorthand notations outside of php.ini, instead use an integer value of bytes."

http://php.net/manual/en/faq.using.php#faq.using.shorthandbytes

However, this contradicts the fact that you can use shorthand notation in the ini_set function.  See the attached test script.

The documentation should be updated to clarify that shorthand notation can be used both in the php.ini and ini_set function. If ini_set shorthand support was added later, it should identify the PHP version in which it was added.

Test script:
---------------
php -r 'var_dump(ini_set("memory_limit","123M"));var_dump(ini_get("memory_limit"));'


Expected result:
----------------
If ini_set could not take shorthand notation, then it would return false, and the call to ini_get would return the original memory limit (of '64M').


Actual result:
--------------
string(3) "64M"
string(4) "123M"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-19 13:09 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2015-05-19 13:09 UTC] cmb@php.net
See also <http://3v4l.org/lHP3b>.
 [2015-12-21 14:42 UTC] tpunt@php.net
Automatic comment from SVN on behalf of tpunt
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=338336
Log: Resolve doc bug #68292
 [2015-12-21 14:43 UTC] tpunt@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: tpunt
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 10:00:01 2026 UTC