#33595 [Com]: recursive references leak memory
ID: 33595 Comment by: marek at lewczuk dot com Reported By: rodricg at sellingsource dot com Status: Assigned Bug Type: Class/Object related Operating System: * PHP Version: 6CVS-2005-08-02 Assigned To: dmitry New Comment: The bug still exists in 5.1.1. If this cannot be solved in near future then I think it should be noted somewhere in the manual. Previous Comments: [2005-08-01 11:00:32] [EMAIL PROTECTED] Yes. This is different bug. However it is not very critical (as bug #33487 too), because all memory is freed on request shutdown. I don't know how to implement support for circular data structures freeing without significant performance lose. [2005-07-07 03:49:52] rodricg at sellingsource dot com Distinctly different than bug #33487 this only occurs when the object contains a recursive reference. Add echo number_format(memory_get_usage()); to the end of the script and you get 346,360,656. Then comment out $this-parent = $parent and run again to get 53,832. I suspect the internal reference is not properly invalidated upon the destruction of class A. This would keep the ref count 0 and foil garbage collection. Unless I am missing something [2005-07-06 23:44:25] rodricg at sellingsource dot com Description: Objects with recursive references leak memory. PHP 5.1.0b2 exhibits the same behavior. Reproduce code: --- ?php class A { function __construct () { $this-b = new B($this); } } class B { function __construct ($parent = NULL) { $this-parent = $parent; } } for ($i = 0 ; $i 100 ; $i++) { $a = new A(); } ? Expected result: Memory usage should remain constant. Actual result: -- Memory usage quickly increases to consume several hundred megabytes. -- Edit this bug report at http://bugs.php.net/?id=33595edit=1
#32671 [NEW]: Array keys converted from float to integer
From: marek at lewczuk dot com Operating system: Linux PHP version: 5.0.3 PHP Bug Type: Arrays related Bug description: Array keys converted from float to integer Description: Suppose we have a float value: $value = 345.332 and we want to use this value as an array key: $array[$value] = $value. This will cause that key will be truncated to integer 345 not to string 345.332. It is written in the manual that: ...A key may be either an integer or a string. If a key is the standard representation of an integer, it will be interpreted as such (i.e. 8 will be interpreted as 8, while 08 will be interpreted as 08)... From this point of view floats should be converted to strings. I'm not saying that this is a bug, rather I would like to be sure if this is a proper behavior. Simple solution is to type cast float value to string (string), but we have to know that given value is a float (and sometimes, we don't know that). IMHO any other type than integer should be treat as string. Reproduce code: --- $value = 345.654; $array = array(); $array[$value] = Float; Expected result: array ( 345.654 = Float ) Actual result: -- array ( 345 = Float ) -- Edit bug report at http://bugs.php.net/?id=32671edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32671r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32671r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32671r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=32671r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=32671r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32671r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32671r=needscript Try newer version: http://bugs.php.net/fix.php?id=32671r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32671r=support Expected behavior: http://bugs.php.net/fix.php?id=32671r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32671r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32671r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=32671r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32671r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=32671r=dst IIS Stability: http://bugs.php.net/fix.php?id=32671r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32671r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32671r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32671r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32671r=mysqlcfg
#32671 [Opn]: Array keys converted from float to integer
ID: 32671 User updated by: marek at lewczuk dot com Reported By: marek at lewczuk dot com Status: Open Bug Type: Arrays related Operating System: Linux PHP Version: 5.0.3 New Comment: One more example, what problem this bug/behavior may cause: $value1 = 345.654; $value2 = 345.655; $array = array(); $array[$value1] = $value1; $array[$value2] = $value2; Result: array ( 345 = 345.655, ) If this is a normal behavior you should put a note about this in the manual. Previous Comments: [2005-04-11 16:19:04] marek at lewczuk dot com Description: Suppose we have a float value: $value = 345.332 and we want to use this value as an array key: $array[$value] = $value. This will cause that key will be truncated to integer 345 not to string 345.332. It is written in the manual that: ...A key may be either an integer or a string. If a key is the standard representation of an integer, it will be interpreted as such (i.e. 8 will be interpreted as 8, while 08 will be interpreted as 08)... From this point of view floats should be converted to strings. I'm not saying that this is a bug, rather I would like to be sure if this is a proper behavior. Simple solution is to type cast float value to string (string), but we have to know that given value is a float (and sometimes, we don't know that). IMHO any other type than integer should be treat as string. Reproduce code: --- $value = 345.654; $array = array(); $array[$value] = Float; Expected result: array ( 345.654 = Float ) Actual result: -- array ( 345 = Float ) -- Edit this bug report at http://bugs.php.net/?id=32671edit=1
#30358 [Opn]: PHP compilation fails in non-cgi mode
ID: 30358 User updated by: marek at lewczuk dot com Reported By: marek at lewczuk dot com Status: Open Bug Type: Compile Failure Operating System: windows/cygwin PHP Version: 5.0.2 New Comment: Fixed in latest CVS sources. Previous Comments: [2004-10-08 10:28:23] marek at lewczuk dot com Description: I want to use php5 on cygwin (latest version). Compilation is successful if configure was run without any additions (so php will work in cgi mode - no cli etc). But, I need to use php with apache - so php-cli will be compiled. My configure looks like this: ./configure --with-apxs2=/usr/local/apache2/bin/apxs Configure don't return any errors, but make fails on compiling sapi/cli/php.exe. Here is the result: ... internal_functions_cli.lo -lcrypt -lcrypt -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lcrypt -lxml2 -lz -liconv -lm -lcrypt -o sa pi/cli/php.exe main/internal_functions_cli.lo(.text+0x17): In function `php_startup_internal_ex tensions': /usr/src/php-5.0.2/main/internal_functions_cli.c:68: undefined reference to `_ph p_startup_extensions' main/internal_functions_cli.lo(.data+0x0):/usr/src/php-5.0.2/main/internal_funct ions_cli.c:67: undefined reference to `_xml_module_entry' main/internal_functions_cli.lo(.data+0x4):/usr/src/php-5.0.2/main/internal_funct ions_cli.c:67: undefined reference to `_tokenizer_module_entry' main/internal_functions_cli.lo(.data+0x8):/usr/src/php-5.0.2/main/internal_funct ions_cli.c:68: undefined reference to `_basic_functions_module' main/internal_functions_cli.lo(.data+0xc):/usr/src/php-5.0.2/main/internal_funct ions_cli.c:68: undefined reference to `_sqlite_module_entry' main/internal_functions_cli.lo(.data+0x10):/usr/src/php-5.0.2/main/internal_func tions_cli.c:68: undefined reference to `_spl_module_entry' main/internal_functions_cli.lo(.data+0x14):/usr/src/php-5.0.2/main/internal_func tions_cli.c:68: undefined reference to `_simplexml_module_entry' main/internal_functions_cli.lo(.data+0x18):/usr/src/php-5.0.2/main/internal_func tions_cli.c:68: undefined reference to `_session_module_entry' main/internal_functions_cli.lo(.data+0x1c):/usr/src/php-5.0.2/main/internal_func tions_cli.c:69: undefined reference to `_posix_module_entry' main/internal_functions_cli.lo(.data+0x20):/usr/src/php-5.0.2/main/internal_func tions_cli.c:69: undefined reference to `_pcre_module_entry' main/internal_functions_cli.lo(.data+0x28):/usr/src/php-5.0.2/main/internal_func tions_cli.c:69: undefined reference to `_dom_module_entry' main/internal_functions_cli.lo(.data+0x2c):/usr/src/php-5.0.2/main/internal_func tions_cli.c:69: undefined reference to `_ctype_module_entry' main/internal_functions_cli.lo(.data+0x30):/usr/src/php-5.0.2/main/internal_func tions_cli.c:69: undefined reference to `_libxml_module_entry' /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../libcygwin.a(libcmain.o)(.text+0x7 d): undefined reference to [EMAIL PROTECTED]' collect2: ld returned 1 exit status make: *** [sapi/cli/php.exe] Error 1 ... I don't know if this is php problem or cygwin... Reproduce code: --- ./configure --with-apxs2=/usr/local/apache2/bin/apxs make Expected result: should compile Actual result: -- fails -- Edit this bug report at http://bugs.php.net/?id=30358edit=1
#30490 [NEW]: PEAR installation fails
From: marek at lewczuk dot com Operating system: windows/cygwin PHP version: 5CVS-2004-10-20 (dev) PHP Bug Type: *Compile Issues Bug description: PEAR installation fails Description: Latest 5-CVS version compiles fine on wingows/cygwin, but there is some problem with pear installation - fails on make install. $ php --version PHP 5.0.3-dev (cli) (built: Oct 20 2004 10:05:55) Copyright (c) 1997-2004 The PHP Group Zend Engine v2.0.3-dev, Copyright (c) 1998-2004 Zend Technologies $ make install Installing PHP SAPI module: apache2handler /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool ' libphp5.la /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp libphp5.la /usr/local/apache2 /modules/ cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la cp .libs/libphp5.a /usr/local/apache2/modules/libphp5.a ranlib /usr/local/apache2/modules/libphp5.a chmod 644 /usr/local/apache2/modules/libphp5.a libtool: install: warning: remember to run `libtool --finish /usr/src/php5/libs' Warning! dlname not found in /usr/local/apache2/modules/libphp5.la. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/local/apache2/modules/libphp5.so [activating module `php5' in /usr/local/apache2/conf/httpd.conf] Installing PHP CLI binary:/usr/local/bin/ Installing PHP CLI man page: /usr/local/man/man1/ Installing PEAR environment: /usr/local/lib/php/ Signal 11 make[1]: *** [install-pear-installer] Error 139 make: *** [install-pear] Error 2 $ make install-pear Installing PEAR environment: /usr/local/lib/php/ Signal 11 make[1]: *** [install-pear-installer] Error 139 make: *** [install-pear] Error 2 Expected result: install Actual result: -- fails -- Edit bug report at http://bugs.php.net/?id=30490edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30490r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30490r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30490r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=30490r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=30490r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30490r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30490r=needscript Try newer version: http://bugs.php.net/fix.php?id=30490r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30490r=support Expected behavior: http://bugs.php.net/fix.php?id=30490r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30490r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30490r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=30490r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30490r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=30490r=dst IIS Stability: http://bugs.php.net/fix.php?id=30490r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30490r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30490r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30490r=mysqlcfg
#30358 [NEW]: PHP compilation fails in non-cgi mode
From: marek at lewczuk dot com Operating system: windows/cygwin PHP version: 5.0.2 PHP Bug Type: Compile Failure Bug description: PHP compilation fails in non-cgi mode Description: I want to use php5 on cygwin (latest version). Compilation is successful if configure was run without any additions (so php will work in cgi mode - no cli etc). But, I need to use php with apache - so php-cli will be compiled. My configure looks like this: ./configure --with-apxs2=/usr/local/apache2/bin/apxs Configure don't return any errors, but make fails on compiling sapi/cli/php.exe. Here is the result: ... internal_functions_cli.lo -lcrypt -lcrypt -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lcrypt -lxml2 -lz -liconv -lm -lcrypt -o sa pi/cli/php.exe main/internal_functions_cli.lo(.text+0x17): In function `php_startup_internal_ex tensions': /usr/src/php-5.0.2/main/internal_functions_cli.c:68: undefined reference to `_ph p_startup_extensions' main/internal_functions_cli.lo(.data+0x0):/usr/src/php-5.0.2/main/internal_funct ions_cli.c:67: undefined reference to `_xml_module_entry' main/internal_functions_cli.lo(.data+0x4):/usr/src/php-5.0.2/main/internal_funct ions_cli.c:67: undefined reference to `_tokenizer_module_entry' main/internal_functions_cli.lo(.data+0x8):/usr/src/php-5.0.2/main/internal_funct ions_cli.c:68: undefined reference to `_basic_functions_module' main/internal_functions_cli.lo(.data+0xc):/usr/src/php-5.0.2/main/internal_funct ions_cli.c:68: undefined reference to `_sqlite_module_entry' main/internal_functions_cli.lo(.data+0x10):/usr/src/php-5.0.2/main/internal_func tions_cli.c:68: undefined reference to `_spl_module_entry' main/internal_functions_cli.lo(.data+0x14):/usr/src/php-5.0.2/main/internal_func tions_cli.c:68: undefined reference to `_simplexml_module_entry' main/internal_functions_cli.lo(.data+0x18):/usr/src/php-5.0.2/main/internal_func tions_cli.c:68: undefined reference to `_session_module_entry' main/internal_functions_cli.lo(.data+0x1c):/usr/src/php-5.0.2/main/internal_func tions_cli.c:69: undefined reference to `_posix_module_entry' main/internal_functions_cli.lo(.data+0x20):/usr/src/php-5.0.2/main/internal_func tions_cli.c:69: undefined reference to `_pcre_module_entry' main/internal_functions_cli.lo(.data+0x28):/usr/src/php-5.0.2/main/internal_func tions_cli.c:69: undefined reference to `_dom_module_entry' main/internal_functions_cli.lo(.data+0x2c):/usr/src/php-5.0.2/main/internal_func tions_cli.c:69: undefined reference to `_ctype_module_entry' main/internal_functions_cli.lo(.data+0x30):/usr/src/php-5.0.2/main/internal_func tions_cli.c:69: undefined reference to `_libxml_module_entry' /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../libcygwin.a(libcmain.o)(.text+0x7 d): undefined reference to [EMAIL PROTECTED]' collect2: ld returned 1 exit status make: *** [sapi/cli/php.exe] Error 1 ... I don't know if this is php problem or cygwin... Reproduce code: --- ./configure --with-apxs2=/usr/local/apache2/bin/apxs make Expected result: should compile Actual result: -- fails -- Edit bug report at http://bugs.php.net/?id=30358edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30358r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30358r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30358r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=30358r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=30358r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30358r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30358r=needscript Try newer version: http://bugs.php.net/fix.php?id=30358r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30358r=support Expected behavior: http://bugs.php.net/fix.php?id=30358r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30358r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30358r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=30358r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30358r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=30358r=dst IIS Stability: http://bugs.php.net/fix.php?id=30358r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30358r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30358r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30358r=mysqlcfg
#30036 [Bgs]: In_Array not works when array contain booleans
ID: 30036 User updated by: marek at lewczuk dot com Reported By: marek at lewczuk dot com Status: Bogus Bug Type: Arrays related Operating System: Windows PHP Version: 4.3.8 New Comment: Right, it works with 3rd parameter, but it is not the point - is string test equal to boolean true ? Even if we are not comparing variable types, then test is not equal to 1. For example, I have an array with strings, integers, boolean - I'm looking for any 123 value - I don't care if this is an integer or string - the value is important. In this case, I can't use in_array with 3rd parameter, because it will not find all all correct values. examples: in_array('232', array(232, '232', true)) this will return true - correct in_array('232', array(232, true), true) this will return false - correct in_array('232', array(233, '233', true)) this will return true - wrong In my opinion this is not correct behavior... Previous Comments: [2004-09-15 10:56:57] [EMAIL PROTECTED] Use the 3rd optional parameter (for strict search) which makes in_array() to check the type too. NOT a bug. [2004-09-09 10:04:27] marek at lewczuk dot com Description: When you have an array with boolean values, then in_array will always return true. Reproduce code: --- print in_array(test it, array(true, true, sdsd = true)) Expected result: should return false Actual result: -- true -- Edit this bug report at http://bugs.php.net/?id=30036edit=1
#30036 [NEW]: In_Array not works when array contain booleans
From: marek at lewczuk dot com Operating system: Windows PHP version: 4.3.8 PHP Bug Type: Arrays related Bug description: In_Array not works when array contain booleans Description: When you have an array with boolean values, then in_array will always return true. Reproduce code: --- print in_array(test it, array(true, true, sdsd = true)) Expected result: should return false Actual result: -- true -- Edit bug report at http://bugs.php.net/?id=30036edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30036r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30036r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30036r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=30036r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=30036r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30036r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30036r=needscript Try newer version: http://bugs.php.net/fix.php?id=30036r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30036r=support Expected behavior: http://bugs.php.net/fix.php?id=30036r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30036r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30036r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=30036r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30036r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=30036r=dst IIS Stability: http://bugs.php.net/fix.php?id=30036r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30036r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30036r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30036r=mysqlcfg
#27758 [Com]: High memory usage/leak
ID: 27758 Comment by: marek at lewczuk dot com Reported By: tingle at virtuanews dot co dot uk Status: Open Bug Type: Performance problem Operating System: Windows 2000 SP4 PHP Version: 5CVS-2004-03-29 (dev) New Comment: It is still not working. Right now I'm using Apache 2.0.48 and latest PHP5 build (20040527). It is really annoying - I have to reset apache every 5 minutes, because after each loaded page apache's memory usage is growing. It seems that memory used by PHP (or by php output buffer) isn't reset when page has been loaded. It is really annoying bug... Previous Comments: [2004-05-25 14:46:14] marek at lewczuk dot com I have the same problem - Apache 2.0.48 + latest PHP5. [2004-05-13 17:12:30] technik at perlentaucher dot de Same Problem here. System is : Apache 2.0.48 on Gentoo, using latest snapshot of PHP5 ( php5-200405131230 ) Memory Leak happens while running following code : htmlbody?php for ( $x=0; $x600; $x++ ) { $db = mysql_connect(localhost, user, password); mysql_select_db(database); $sql = select * from tab; // About 17.000 Big Records $result = mysql_query($sql); // !!! causes MEM-Leak !!! mysql_close($db); } ?/body/html Mem-Leak differs in Size. When reducing load eg. by making the loop smaller it disapears sometime. It happens at the Point where the Data ist loaded into the result-Array. Greetings, Adam [2004-05-07 18:40:00] ppmm at wuxinan dot net Try to use Apache 2.0.48. I have exactly the same problem on the same platform. But when I go back to the older version of Apache, the problem no long exists. [2004-05-03 20:53:00] jpleveille at gameloft dot com I noticed that on the RC2. Is that fixed? I got memory usage increased of 1 to 8 megabytes sometimes. Have to reload Apache every 10 minutes sometimes, annoying! JP. [2004-04-18 10:35:57] tingle at virtuanews dot co dot uk Hi, Sorry for the delay - I was not in a position to download the latest CVS due to a very slow web connection, this has now changed and I have just downloaded the latest file. The problem is now MUCH better, but is still there slightly, where as before it would increase with about 500KB each refresh, it does it by about 50KB each time. It is not as bad, but it is still there 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/27758 -- Edit this bug report at http://bugs.php.net/?id=27758edit=1
#28527 [NEW]: Sorting arrays in utf-8 charset not possible
From: marek at lewczuk dot com Operating system: Windows XP PHP version: 5CVS-2004-05-26 (dev) PHP Bug Type: Arrays related Bug description: Sorting arrays in utf-8 charset not possible Description: One year ago I have send info about a bug related on sorting arrays with special, language specific characters like ¶±æ. The bug has closed status, so it should be working. But is not... All characters are encoded in UTF-8 and also I have made proper setLocale. I don't know if this is a problem with Windows or PHP, but I think that this bug will be also present on Linux machines. The code: SetLocale(LC_COLLATE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); SetLocale(LC_CTYPE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); $array = array (¦liwka, Zook, Alfa, Beta, Shit); sort($array); print_r($array); Current result of sorting: Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = Zook [4] = ¦liwka ) And it should be: Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = ¦liwka [4] = Zook ) Reproduce code: --- SetLocale(LC_COLLATE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); SetLocale(LC_CTYPE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); $array = array (¦liwka, Zook, Alfa, Beta, Shit); sort($array); print_r($array); Expected result: Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = ¦liwka [4] = Zook ) Actual result: -- Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = Zook [4] = ¦liwka ) -- Edit bug report at http://bugs.php.net/?id=28527edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28527r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28527r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28527r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28527r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28527r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28527r=needscript Try newer version: http://bugs.php.net/fix.php?id=28527r=oldversion Not developer issue:http://bugs.php.net/fix.php?id=28527r=support Expected behavior: http://bugs.php.net/fix.php?id=28527r=notwrong Not enough info:http://bugs.php.net/fix.php?id=28527r=notenoughinfo Submitted twice:http://bugs.php.net/fix.php?id=28527r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28527r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28527r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28527r=dst IIS Stability: http://bugs.php.net/fix.php?id=28527r=isapi Install GNU Sed:http://bugs.php.net/fix.php?id=28527r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28527r=float
#28527 [Bgs]: Sorting arrays in utf-8 charset not possible
ID: 28527 User updated by: marek at lewczuk dot com Reported By: marek at lewczuk dot com Status: Bogus Bug Type: Arrays related Operating System: Windows XP PHP Version: 5CVS-2004-05-26 (dev) New Comment: Ok, so lets try to do it with usort() and strcoll(). Strcoll() isn't working at all - it always return 2147483647. So Previous Comments: [2004-05-26 14:21:20] [EMAIL PROTECTED] PHP sorts according to ascii, not a charset so this is not a bug. You will need to use usort() and strcoll() to get this to work. Not a bug - bogus. [2004-05-26 14:06:13] marek at lewczuk dot com Description: One year ago I have send info about a bug related on sorting arrays with special, language specific characters like ¶±æ. The bug has closed status, so it should be working. But is not... All characters are encoded in UTF-8 and also I have made proper setLocale. I don't know if this is a problem with Windows or PHP, but I think that this bug will be also present on Linux machines. The code: SetLocale(LC_COLLATE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); SetLocale(LC_CTYPE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); $array = array (¦liwka, Zook, Alfa, Beta, Shit); sort($array); print_r($array); Current result of sorting: Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = Zook [4] = ¦liwka ) And it should be: Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = ¦liwka [4] = Zook ) Reproduce code: --- SetLocale(LC_COLLATE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); SetLocale(LC_CTYPE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); $array = array (¦liwka, Zook, Alfa, Beta, Shit); sort($array); print_r($array); Expected result: Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = ¦liwka [4] = Zook ) Actual result: -- Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = Zook [4] = ¦liwka ) -- Edit this bug report at http://bugs.php.net/?id=28527edit=1
#28527 [Bgs]: Sorting arrays in utf-8 charset not possible
ID: 28527 User updated by: marek at lewczuk dot com Reported By: marek at lewczuk dot com Status: Bogus Bug Type: Arrays related Operating System: Windows XP PHP Version: 5CVS-2004-05-26 (dev) New Comment: Sorry. You are right. The problem was in not-proper setLocal settings. It is working with usort and strcoll. Sorry for bogus. Previous Comments: [2004-05-26 17:04:12] marek at lewczuk dot com Ok, so lets try to do it with usort() and strcoll(). Strcoll() isn't working at all - it always return 2147483647. So [2004-05-26 14:21:20] [EMAIL PROTECTED] PHP sorts according to ascii, not a charset so this is not a bug. You will need to use usort() and strcoll() to get this to work. Not a bug - bogus. [2004-05-26 14:06:13] marek at lewczuk dot com Description: One year ago I have send info about a bug related on sorting arrays with special, language specific characters like ¶±æ. The bug has closed status, so it should be working. But is not... All characters are encoded in UTF-8 and also I have made proper setLocale. I don't know if this is a problem with Windows or PHP, but I think that this bug will be also present on Linux machines. The code: SetLocale(LC_COLLATE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); SetLocale(LC_CTYPE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); $array = array (¦liwka, Zook, Alfa, Beta, Shit); sort($array); print_r($array); Current result of sorting: Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = Zook [4] = ¦liwka ) And it should be: Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = ¦liwka [4] = Zook ) Reproduce code: --- SetLocale(LC_COLLATE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); SetLocale(LC_CTYPE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); $array = array (¦liwka, Zook, Alfa, Beta, Shit); sort($array); print_r($array); Expected result: Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = ¦liwka [4] = Zook ) Actual result: -- Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = Zook [4] = ¦liwka ) -- Edit this bug report at http://bugs.php.net/?id=28527edit=1
#28527 [Bgs]: Sorting arrays in utf-8 charset not possible
ID: 28527 User updated by: marek at lewczuk dot com Reported By: marek at lewczuk dot com Status: Bogus Bug Type: Arrays related Operating System: Windows XP PHP Version: 5CVS-2004-05-26 (dev) New Comment: Sorry again - it is not working. I have created new bug. Previous Comments: [2004-05-26 17:07:14] marek at lewczuk dot com Sorry. You are right. The problem was in not-proper setLocal settings. It is working with usort and strcoll. Sorry for bogus. [2004-05-26 17:04:12] marek at lewczuk dot com Ok, so lets try to do it with usort() and strcoll(). Strcoll() isn't working at all - it always return 2147483647. So [2004-05-26 14:21:20] [EMAIL PROTECTED] PHP sorts according to ascii, not a charset so this is not a bug. You will need to use usort() and strcoll() to get this to work. Not a bug - bogus. [2004-05-26 14:06:13] marek at lewczuk dot com Description: One year ago I have send info about a bug related on sorting arrays with special, language specific characters like ¶±æ. The bug has closed status, so it should be working. But is not... All characters are encoded in UTF-8 and also I have made proper setLocale. I don't know if this is a problem with Windows or PHP, but I think that this bug will be also present on Linux machines. The code: SetLocale(LC_COLLATE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); SetLocale(LC_CTYPE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); $array = array (¦liwka, Zook, Alfa, Beta, Shit); sort($array); print_r($array); Current result of sorting: Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = Zook [4] = ¦liwka ) And it should be: Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = ¦liwka [4] = Zook ) Reproduce code: --- SetLocale(LC_COLLATE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); SetLocale(LC_CTYPE, $GLOBALS['__OS__'] == WINDOWS ? Polish_Poland.65001 : pl_PL.UTF-8); $array = array (¦liwka, Zook, Alfa, Beta, Shit); sort($array); print_r($array); Expected result: Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = ¦liwka [4] = Zook ) Actual result: -- Array ( [0] = Alfa [1] = Beta [2] = Shit [3] = Zook [4] = ¦liwka ) -- Edit this bug report at http://bugs.php.net/?id=28527edit=1
#27758 [Com]: High memory usage/leak
ID: 27758 Comment by: marek at lewczuk dot com Reported By: tingle at virtuanews dot co dot uk Status: Open Bug Type: Performance problem Operating System: Windows 2000 SP4 PHP Version: 5CVS-2004-03-29 (dev) New Comment: I have the same problem - Apache 2.0.48 + latest PHP5. Previous Comments: [2004-05-13 17:12:30] technik at perlentaucher dot de Same Problem here. System is : Apache 2.0.48 on Gentoo, using latest snapshot of PHP5 ( php5-200405131230 ) Memory Leak happens while running following code : htmlbody?php for ( $x=0; $x600; $x++ ) { $db = mysql_connect(localhost, user, password); mysql_select_db(database); $sql = select * from tab; // About 17.000 Big Records $result = mysql_query($sql); // !!! causes MEM-Leak !!! mysql_close($db); } ?/body/html Mem-Leak differs in Size. When reducing load eg. by making the loop smaller it disapears sometime. It happens at the Point where the Data ist loaded into the result-Array. Greetings, Adam [2004-05-07 18:40:00] ppmm at wuxinan dot net Try to use Apache 2.0.48. I have exactly the same problem on the same platform. But when I go back to the older version of Apache, the problem no long exists. [2004-05-03 20:53:00] jpleveille at gameloft dot com I noticed that on the RC2. Is that fixed? I got memory usage increased of 1 to 8 megabytes sometimes. Have to reload Apache every 10 minutes sometimes, annoying! JP. [2004-04-18 10:35:57] tingle at virtuanews dot co dot uk Hi, Sorry for the delay - I was not in a position to download the latest CVS due to a very slow web connection, this has now changed and I have just downloaded the latest file. The problem is now MUCH better, but is still there slightly, where as before it would increase with about 500KB each refresh, it does it by about 50KB each time. It is not as bad, but it is still there [2004-04-12 17:56:11] [EMAIL PROTECTED] No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to Open. Thank you. 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/27758 -- Edit this bug report at http://bugs.php.net/?id=27758edit=1
#22931 [NEW]: Array Sort/Multisort - wrong string sorting with special, national characters
From: marek at lewczuk dot com Operating system: Linux/Windows PHP version: 4.3.0 PHP Bug Type: Arrays related Bug description: Array Sort/Multisort - wrong string sorting with special, national characters Sorting an array has a very important bug. If your app is using e.g. ISO-8859-2 charset and strings array use special chars like Ś,Ą... PHP doesn't sort strings which use them. I have tried to use setLocale (setLocale is working correctly with strtoupper, strtolower etc.) but nothing. The problem is also in UTF8 charset. This very serious problem... -- Edit bug report at http://bugs.php.net/?id=22931edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=22931r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=22931r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=22931r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=22931r=needtrace Try newer version: http://bugs.php.net/fix.php?id=22931r=oldversion Not developer issue:http://bugs.php.net/fix.php?id=22931r=support Expected behavior: http://bugs.php.net/fix.php?id=22931r=notwrong Not enough info:http://bugs.php.net/fix.php?id=22931r=notenoughinfo Submitted twice:http://bugs.php.net/fix.php?id=22931r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=22931r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22931r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=22931r=dst IIS Stability: http://bugs.php.net/fix.php?id=22931r=isapi Install GNU Sed:http://bugs.php.net/fix.php?id=22931r=gnused
#22931 [Opn]: Array Sort/Multisort - wrong string sorting with special, national characters
ID: 22931 User updated by: marek at lewczuk dot com Reported By: marek at lewczuk dot com Status: Open Bug Type: Arrays related Operating System: Linux/Windows PHP Version: 4.3.0 New Comment: Sorry... I have read about usort and strcoll - yes it's working with setLocale, but... array_multisort still not working ?? Previous Comments: [2003-03-27 10:16:31] marek at lewczuk dot com Sorting an array has a very important bug. If your app is using e.g. ISO-8859-2 charset and strings array use special chars like Ś,Ą... PHP doesn't sort strings which use them. I have tried to use setLocale (setLocale is working correctly with strtoupper, strtolower etc.) but nothing. The problem is also in UTF8 charset. This very serious problem... -- Edit this bug report at http://bugs.php.net/?id=22931edit=1