ID:               33443
 User updated by:  nickj-phpbugs at nickj dot org
 Reported By:      nickj-phpbugs at nickj dot org
 Status:           Open
 Bug Type:         *General Issues
 Operating System: Debian Woody GNU/Linux 3.0r6
 PHP Version:      5CVS-2005-06-23 (dev)
 New Comment:

The .phpt unit-tests are now available for download at:
http://home.swiftdsl.com.au/~npj/php-bugs/bug33443.zip (3KB file)

The results of running them on a PHP-5.1-dev build a few hours old was
as follows:
-----------------------------------------------------------------------
ludo:~/tmp/php-5.1-dev/php5-200506222230#
TEST_PHP_EXECUTABLE=sapi/cli/php sapi/cli/php run-tests.php
../bug33443/*.phpt

=====================================================================
CWD         : /root/tmp/php-5.1-dev/php5-200506222230
PHP         : sapi/cli/php 
PHP_SAPI    : cli
PHP_VERSION : 5.1.0-dev
ZEND_VERSION: 2.1.0-dev
PHP_OS      : Linux - Linux ludo 2.6.7-1-686 #1 Wed Jul 28 12:29:51
CEST 2004 i686
INI actual  : /root/tmp/php-5.1-dev/php5-200506222230/sapi/cli/php.ini
More .INIs  : 
Extra dirs  : 
=====================================================================
Running selected tests.
PASS Bug #33443 [0] (ini_get("allow_url_fopen") should return boolean
string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-0.phpt]
PASS Bug #33443 [1] (ini_get("allow_url_fopen") should return boolean
string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-1.phpt]
FAIL Bug #33443 [false] (ini_get("allow_url_fopen") should return
boolean string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-false.phpt]
FAIL Bug #33443 [no] (ini_get("allow_url_fopen") should return boolean
string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-no.phpt]
FAIL Bug #33443 [none] (ini_get("allow_url_fopen") should return
boolean string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-none.phpt]
FAIL Bug #33443 [off] (ini_get("allow_url_fopen") should return boolean
string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-off.phpt]
FAIL Bug #33443 [on-literal] (ini_get("allow_url_fopen") should return
boolean string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-on-literal.phpt]
PASS Bug #33443 [on] (ini_get("allow_url_fopen") should return boolean
string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-on.phpt]
PASS Bug #33443 [true] (ini_get("allow_url_fopen") should return
boolean string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-true.phpt]
PASS Bug #33443 [yes] (ini_get("allow_url_fopen") should return boolean
string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-yes.phpt]

=====================================================================
Number of tests :   10                10
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    5 ( 50.0%) ( 50.0%)
Tests passed    :    5 ( 50.0%) ( 50.0%)
---------------------------------------------------------------------
Time taken      :    0 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #33443 [false] (ini_get("allow_url_fopen") should return boolean
string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-false.phpt]
Bug #33443 [no] (ini_get("allow_url_fopen") should return boolean
string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-no.phpt]
Bug #33443 [none] (ini_get("allow_url_fopen") should return boolean
string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-none.phpt]
Bug #33443 [off] (ini_get("allow_url_fopen") should return boolean
string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-off.phpt]
Bug #33443 [on-literal] (ini_get("allow_url_fopen") should return
boolean string, not the literal string)
[/root/tmp/php-5.1-dev/bug33443/bug33443-on-literal.phpt]
=====================================================================
ludo:~/tmp/php-5.1-dev/php5-200506222230# 
-----------------------------------------------------------------------


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

[2005-06-23 06:28:12] nickj-phpbugs at nickj dot org

Description:
------------
Currently ini_get("allow_url_fopen") appears to return a literal
string, not a boolean value/string. For example, if the php.ini
contains "allow_url_fopen = on", then ini_get("allow_url_fopen") will
return "on", not "1". This is inconsistent with the documentation.

The php.ini documentation at
http://au3.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen
says 'allow_url_fopen' is a "boolean" configuration directive.

The ini_get() documentation at http://php.net/ini-get says:
When querying boolean values:  A boolean ini value of 'off' will be
returned as an empty string or "0" while a boolean ini value of 'on'
will be returned as "1".

Therefore, if the php.ini contains "allow_url_fopen = on", then
ini_get("allow_url_fopen") should return "1"; but it does not.

Additionally, in the php.ini itself, it lists the supported INI boolean
constants as being "On, Off, True, False, Yes, No and None". It would
therefore probably be good if (in addition to the 'on' and 'off'
constants) the 'true', 'false', 'yes', 'no' and 'none' constants worked
in the same way as well.

I have written a series of small .phpt PHP unit-tests that demonstrate
the above, and I will add a URL for these in the next few minutes.



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


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

Reply via email to