ID:               42657
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jcortinap at googlemail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         *Configuration Issues
 Operating System: Win XP Pro / Win 2003 Server
 PHP Version:      5.2.4
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

http://www.php.net/ini_get says:

"Returns the value of the configuration option as a string on success,
or an empty string on failure or for null values."

So this is expected behavior when an ini option isn't set at all.


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

[2007-09-13 12:28:56] jcortinap at googlemail dot com

Description:
------------
This problem was found trying to set the sendmail_from directive from a
script. This directive is intentionally NOT set on the php.ini (it is
commented out).

According to the documentation, ini_get should return an empty string
since the directive is not set, but it returns a boolean false.

When calling ini_set to set the value, it is expected to get the old
value on success or FALSE on failure, and what we experience is that the
setting is correctly set, but FALSE is returned.

My theory is that ini_set is working correctly returning the "old"
value of the setting, but since the old value is being returned as FALSE
from ini_get, this is what we get as a return from ini_set, so the
problem seems to be in the ini_get function.

Tested with the same results on both 4.4.7 and 5.2.4.

Reproduce code:
---------------
// sendmail_from not set in php.ini. This should return an empty
string
$value = ini_get('sendmail_from');
var_dump($value);

// sendmail_from is correctly set, so an empty string should be
returned
$old_value = ini_set('sendmail_from', '[EMAIL PROTECTED]');
var_dump($old_value);

// new value of the sendmail_from directive is correctly set
$value = ini_get('sendmail_from');
var_dump($value);


Expected result:
----------------
string(0) ""
string(0) ""
string(16) "[EMAIL PROTECTED]" 

Actual result:
--------------
bool(false)
bool(false)
string(16) "[EMAIL PROTECTED]" 


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


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

Reply via email to