This is a discussion on Ambiguity in result if ini_set within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I find that w.r.t. docs: string ini_set ( string varname, string newvalue) Sets the value of the given configuration ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I find that w.r.t. docs:
string ini_set ( string varname, string newvalue) Sets the value of the given configuration option. Returns the old value on success, FALSE on failure. if the old value is FALSE (or the indistinguishable NULL, or ""), the result cannot be used to discover failure. Have I misunderstood? Or must I discover failure some other way e.g. ini_get. Thanks. -- Chris |
|
|||
|
Chris John Jordan <chrisjj@despammed.com> wrote:
> I find that w.r.t. docs: > > string ini_set ( string varname, string newvalue) > > Sets the value of the given configuration option. Returns the old value > on success, FALSE on failure. > > if the old value is FALSE (or the indistinguishable NULL, or ""), the > result cannot be used to discover failure. > > Have I misunderstood? Or must I discover failure some other way e.g. > ini_get. Hi Chris, CHeck the return value with === or !== e.g. if(ini_set("somevar", "somevalue")===FALSE){ if(ini_set("somevar", "somevalue")!==FALSE){ If the old value was FALSE or 0 it will be returned as string, not boolean. HTH; JOn |