#25865 [Bgs->Asn]: ini_get returns 0 not "" for boolean?
| From: | nlopess@php.net | Date: | Wed, 07 Jul 2004 18:54:55 +0000 |
| Subject: | #25865 [Bgs->Asn]: ini_get returns 0 not "" for boolean? | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969361749@lists.php.net to get a copy of this message | ||
ID: 25865
Updated by: nlopess@php.net
Reported By: php dot net at b-a-l-u dot de
-Status: Bogus
+Status: Assigned
Bug Type: Documentation problem
Operating System: Linux
PHP Version: Irrelevant
-Assigned To:
+Assigned To: nlopess
New Comment:
re-open this.
reference: http://news.php.net/php.doc/969361748
Previous Comments:
------------------------------------------------------------------------
[2004-07-07 18:48:56] a-konovalenko at yandex dot ru
This is not bogus! I can reproduce it when the option comes from the
.htaccess file (set with php_flag). ini_get() returns "0" instead of ""
for the options that are off.
I'm using PHP 4.3.4 under Apache 1.3.31.
(Even if this is fixed in the latest version of PHP, the documentation
should be updated for the older ones.)
P.S. Will my comment reopen this bug automatically or should I do
something special?
------------------------------------------------------------------------
[2003-10-14 12:38:32] sniper@php.net
# php -r "var_dump(ini_get('register_globals'));"
string(0) ""
------------------------------------------------------------------------
[2003-10-14 11:44:46] php dot net at b-a-l-u dot de
Description:
------------
http://www.php.net/manual/en/function.ini-get.php
tells me that
"When querying boolean values: A boolean ini value of off will be
returned as an empty string while a boolean ini value of on will be
returned as "1"."
But
echo '['.ini_get('register_globals').']';
displays '[0]' not '[]'?
At least this is the behaviour I have with php-4.1.2 on debian woody.
Balu
PS: It'd be nice to add the hint of "beyer at <nospam>clickhand dot de"
from the notes on that page regarding casting the value using (bool) to
the main description.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25865&edit=1