[PHP-BUG] Bug #60531 [NEW]: Bug logical if

2011-12-15 Thread onekamil at gmail dot com
From: 
Operating system: debian 6.0
PHP version:  5.3SVN-2011-12-15 (SVN)
Package:  Variables related
Bug Type: Bug
Bug description:Bug logical if

Description:

Logical comparison if($var1==0 or $var2=='string') (FALSE or FALSE)= TRUE,
Secend 
FALSE is TRUE but $var2 is not 'string'




Test script:
---
http://screenshooter.net/3491371/bvnfexf
http://screenshooter.net/3491371/rgjtiaq

foreach($xml['photos']['photo'] as $keydupa=$item) {
if(count($item)===0 or $keydupa=='binary_photo') {  

continue;
}
}



Expected result:

test

Actual result:
--
 test

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



Bug #30195 [Com]: scandir etc cannot read Chinese file/folder name

2010-08-29 Thread onekamil at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=30195edit=1

 ID: 30195
 Comment by: onekamil at gmail dot com
 Reported by:percy at savant dot us
 Summary:scandir etc cannot read Chinese file/folder name
 Status: No Feedback
 Type:   Bug
 Package:*Directory/Filesystem functions
 Operating System:   windows xp/2003
 PHP Version:5CVS-2004-09-22 (dev)
 Block user comment: N

 New Comment:

Hi, have the same problem and my solution is: using
mb_convert_encoding.



$open = opendir($path);

foreach( $open as $value ) 

{

   $value = mb_convert_encoding($value, mb_detect_order($value),
UTF-8);

}



If saving file to folder using urlencode. To view using urldecode.


Previous Comments:

[2007-03-31 23:30:05] missingno at ifrance dot com

Same problem here.



On WinXP with PHP 5.2.0, using iso-8859-1 as charset for the system
(though the filesystem uses utf-8 for folders/files names).



I need to access folders whose names are encoded using UTF-8.

readdir/scandir won't allow me to do so (returning '?' for characters
outside the system charset).





The page is served like this:

header('Content-Type: text/html; charset=utf-8');

So the browser really isn't at fault.

Serving the document with a more specific charset is not an option since
I have to display texts in many different languages on the page.



As moleary at preg dot org suggested, it would be really nice to have an
option to force PHP to use a certain encoding while accessing the
filesystem. Or maybe, make it so that it uses the same encoding as the
filesystem instead of defaulting to iso-8859-1...


[2006-07-10 10:02:31] gandhavallakiran at yahoo dot co dot in

hi i have used the babel class in my coding of php. but it could not
read the characters of china and japan i.e. special characters. it is
displaying the blank space instead of china or  japan text. could you
help me in this reacord how to display china characters in php. please
it is very urgent kindly help me.


[2005-02-25 01:00:07] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to Open.


[2005-02-17 15:22:16] moriyo...@php.net

Note that all of these are PHP code, so paste it within 

?php ?.




[2005-02-17 15:20:57] moriyo...@php.net

You might have shown strings of a native encoding as 

UTF-8 in your browser, most likely because of wrong 

Content-Type.



Try putting one of the following at the top of your 

script and let's see what'll happen:



CP936 (Simplified Chinese):



  header('Content-Type', 'text/html; charset=GB2312');



CP949 (Korean):



  header('Content-Type', 'text/html; charset=EUC-KR');



CP950 (Traditional Chinese):



  header('Content-Type', 'text/html; charset=BIG5');



CP932 (Japanese):



  header('Content-Type', 'text/html; 

charset=Shift_JIS');








The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=30195


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