From:             
Operating system: GNU linux but may be any
PHP version:      5.3.5
Package:          *General Issues
Bug Type:         Feature/Change Request
Bug description:...

Description:
------------
---

>From manual page: http://www.php.net/function.ini-get#Return Values

---

Hello everyone!



First (since I am from Poland) I have to apologise for my english, it's not
very clean or gramatically correct but i'm sure you will understand what i
intend to say...



I am writing to you in order to make you noticed that the function
ini_get() returns value that cannot be properly identified using the
comparison operators (==,===,!==,etc) wheter this is an function error or
an empty string which implicates that the php.ini configuration directive
named 'disable_functions' (and not only this one) is empty which means "not
set".



---

>From manual page: http://www.php.net/function.ini-get#Return Values: 



The function ini_get returns value of string type in two cases which
represents two different states of function: 



 - first it returns empty "string" value when the directive is empty which
also means "not set" (it's a neutral state - it's no error neither other
'bad thing')



 - secondly it returns empty "string" value when function encounters an
error during its runtime.



The bit operators (===, !==) cannot match wheter the returned value is an
error state or an "neutral" state (an empty string) because they're both
string type of data and they are both empty...

---



I wrote a short script to show you what problem i encounter. If there is
any solution which doesn't need rewriting the ini_get function code i would
be happy to hear it...below is the script i wrote :



Test script:
---------------
/*php.ini:

making the below directive empty which means not set

disable_functions = 

*/

//storing the result into the variable for example

$iniget = ini_get('disable_functions');

if($iniget === '') {

   die('disable_funtions failed');

/*

it fails at this point because the $iniget var may contain both the
function's error state (as an empty string) and the neutral state (as an
empty string) which means that this directive is not set but it's not an
error in anyway...

*/

}

Expected result:
----------------
the above script displays "disable_funtions failed" and prevent any futher
code from running.(die function) despite the fact that it's not an error
altough the php.ini's directive is 

empty = not set...I hope you can see the problem here.

If this is 


-- 
Edit bug report at http://bugs.php.net/bug.php?id=53940&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53940&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53940&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53940&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53940&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53940&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53940&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53940&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53940&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53940&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53940&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53940&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53940&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53940&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53940&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53940&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53940&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53940&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53940&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53940&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53940&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53940&r=mysqlcfg

Reply via email to