#47379 [NEW]: After defining namespace using curly brace, we can't have any statement then

2009-02-12 Thread vivekanandan8 at yahoo dot com
From: vivekanandan8 at yahoo dot com
Operating system: debian linux 
PHP version:  5.3.0beta1
PHP Bug Type: *Programming Data Structures
Bug description:  After defining namespace using curly brace, we can't have any 
statement then

Description:

when defining the namespace using the curly brace,no statement can't be
accepted after the end of namespace,hence we are forced to use in the
separate include file.
where as other format of defining namespace like 
namsespace a; works fine.


Reproduce code:
---



Expected result:

Expected Result :user

Actual result:
--
Fatal error: No code may exist outside of namespace {} in
/usr/local/apache/htdocs/php/nstest.php on line 7

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



#43831 [Ver->Csd]: $this gets mangled when extending PDO with persistent connection

2009-02-12 Thread felipe
 ID:   43831
 Updated by:   fel...@php.net
 Reported By:  mjs at beebo dot org
-Status:   Verified
+Status:   Closed
 Bug Type: PDO related
 Operating System: OS X/Linux
 PHP Version:  5.2CVS, 5.3CVS, 6CVS
-Assigned To:  wez
+Assigned To:  felipe
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2009-02-02 18:55:26] dennis at born05 dot nl

A simpler case might be:

class MyPDO extends PDO {}

$bar = new PDO("sqlite::memory:", null, null, 
array(PDO::ATTR_PERSISTENT => true));
$baz = new MyPDO("sqlite::memory:", null, null, 
array(PDO::ATTR_PERSISTENT => true));

var_dump ($bar);
var_dump ($baz);

It looks like it internally caches the object, not just the 
connection..

Tested on Fedora Core 6, latest snaps of both 5.2 and 5.3 branch.



[2008-10-24 21:13:03] fel...@php.net

/home/felipe/dev/php5/ext/pdo/pdo_dbh.c(1516) :  Freeing 0x088CEA34 (44
bytes), script=../bug.php
[Fri Oct 24 18:55:13 2008]  Script:  '../bug.php'
/home/felipe/dev/php5/ext/pdo/pdo_dbh.c(1517) :  Freeing 0x088D7844 (32
bytes), script=../bug.php
/home/felipe/dev/php5/Zend/zend_alloc.c(2391) : Actual location
(location was relayed)
=== Total 2 memory leaks detected ===




[2008-10-24 21:12:47] fel...@php.net

/home/felipe/dev/php5/ext/pdo/pdo_dbh.c(1516) :  Freeing 0x088CEA34 (44
bytes), script=../bug.php
[Fri Oct 24 18:55:13 2008]  Script:  '../bug.php'
/home/felipe/dev/php5/ext/pdo/pdo_dbh.c(1517) :  Freeing 0x088D7844 (32
bytes), script=../bug.php
/home/felipe/dev/php5/Zend/zend_alloc.c(2391) : Actual location
(location was relayed)
=== Total 2 memory leaks detected ===




[2008-01-13 20:55:43] mjs at beebo dot org

Description:

The class of $this changes after the instantiation of a class which 
extends PDO, and which specifies PDO::ATTR_PERSISTENT attribute.



Reproduce code:
---
class Foo extends PDO {
function __construct($dsn) {
parent::__construct($dsn, null, null, 
array(PDO::ATTR_PERSISTENT =>
true));
}
}

class Baz extends PDO {
function __construct($dsn) {
parent::__construct($dsn, null, null, 
array(PDO::ATTR_PERSISTENT =>
true));
}
}

class Bar extends Baz {
function quux() {
echo get_class($this), "\n";
$foo = new Foo("sqlite::memory:");
echo get_class($this), "\n";
}
}

$bar = new Bar("sqlite::memory:");
$bar->quux();



Expected result:

Bar
Bar

i.e. get_class($this) returns the same value each time

Actual result:
--
Bar
Foo

i.e. $this gets mangled





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



#45432 [Ver->Csd]: PDO: persistent connection leak

2009-02-12 Thread felipe
 ID:   45432
 Updated by:   fel...@php.net
 Reported By:  uwendel at mysql dot com
-Status:   Verified
+Status:   Closed
 Bug Type: PDO related
 Operating System: Linux 64bit
 PHP Version:  5.3CVS-2008-07-04 (CVS)
-Assigned To:  
+Assigned To:  felipe
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2008-10-29 23:38:09] fel...@php.net

That is related to #43831, the cached dbh have your data changed
disregarding the dbh->ce, and the alloced 'properties' isn't freed.



[2008-07-04 17:39:22] uwendel at mysql dot com

Description:

Creating a persistent connection handle and assigning a new persistent
connection to the same handle (variable) causes a leak.

$db = new PDO(...)
$db = new PDO(...) <--- leak


My PHP 5.3 CVS snapshot is a little older than 04.07.2008, anyway.
nixn...@ulflinux:~/php53> sapi/cli/php -v
PHP 5.3.0-dev (cli) (built: Jul  3 2008 16:20:01) (DEBUG)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2008 Zend Technologies


Reproduce code:
---
nixn...@ulflinux:~/php53> valgrind sapi/cli/php -r '$db = new 

PDO("sqlite:/tmp/foo", NULL, NULL, array(PDO::ATTR_PERSISTENT =>
true)); $db = new PDO("sqlite:/tmp/foo", NULL, NULL,
array(PDO::ATTR_PERSISTENT => true));'
==32328== Memcheck, a memory error detector.
==32328== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et
al.
==32328== Using LibVEX rev 1804, a library for dynamic binary
translation.
==32328== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==32328== Using valgrind-3.3.0, a dynamic binary instrumentation
framework.
==32328== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et
al.
==32328== For more details, rerun with: -v
[Fri Jul  4 19:35:02 2008]  Script:  '-'
/home/nixnutz/php53/ext/pdo/pdo_dbh.c(1513) :  Freeing 0x0655C3C8 (72
bytes), script=-
[Fri Jul  4 19:35:02 2008]  Script:  '-'
/home/nixnutz/php53/ext/pdo/pdo_dbh.c(1514) :  Freeing 0x0655C468 (64
bytes), script=-
/home/nixnutz/php53/Zend/zend_alloc.c(2374) : Actual location (location
was relayed)
=== Total 2 memory leaks detected ===
==32328==
==32328== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from
0)
==32328== malloc/free: in use at exit: 91,869 bytes in 137 blocks.
==32328== malloc/free: 11,910 allocs, 11,773 frees, 3,125,629 bytes
allocated.
==32328== For counts of detected errors, rerun with: -v
==32328== searching for pointers to 137 not-freed blocks.
==32328== checked 558,296 bytes.
==32328==
==32328== LEAK SUMMARY:
==32328==definitely lost: 11,325 bytes in 128 blocks.
==32328==  possibly lost: 456 bytes in 6 blocks.
==32328==still reachable: 80,088 bytes in 3 blocks.
==32328== suppressed: 0 bytes in 0 blocks.
==32328== Rerun with --leak-check=full to see details of leaked
memory.







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



#47370 [Opn->Csd]: array_unique has backward compatibility problem, and SORT_REGULAR is confusing

2009-02-12 Thread felipe
 ID:   47370
 Updated by:   fel...@php.net
 Reported By:  for-bugs at hnw dot jp
-Status:   Open
+Status:   Closed
 Bug Type: Arrays related
 Operating System: any
 PHP Version:  5.2.9RC1


Previous Comments:


[2009-02-13 01:53:09] for-bugs at hnw dot jp

Thank you so much. The snapshot returns same result to PHP 5.2.8 with
reproduce code. Such as:

array(2) {
  [0]=>
  int(0)
  [1]=>
  string(0) ""
}
array(2) {
  [0]=>
  string(0) ""
  [1]=>
  string(1) "0"
}



[2009-02-12 18:58:34] moriyo...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/





[2009-02-12 18:12:35] moriyo...@php.net

Verified with 5.2, 5.3, HEAD.




[2009-02-12 16:25:59] for-bugs at hnw dot jp

Sorry, reproduce code was incorrect. Correct code is below:


  int(0)
}
array(2) {
  [0]=>
  string(0) ""
  [1]=>
  string(1) "0"
}





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



#47370 [Fbk->Opn]: array_unique has backward compatibility problem, and SORT_REGULAR is confusing

2009-02-12 Thread for-bugs at hnw dot jp
 ID:   47370
 User updated by:  for-bugs at hnw dot jp
 Reported By:  for-bugs at hnw dot jp
-Status:   Feedback
+Status:   Open
 Bug Type: Arrays related
 Operating System: any
 PHP Version:  5.2.9RC1
 New Comment:

Thank you so much. The snapshot returns same result to PHP 5.2.8 with
reproduce code. Such as:

array(2) {
  [0]=>
  int(0)
  [1]=>
  string(0) ""
}
array(2) {
  [0]=>
  string(0) ""
  [1]=>
  string(1) "0"
}


Previous Comments:


[2009-02-12 18:58:34] moriyo...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/





[2009-02-12 18:12:35] moriyo...@php.net

Verified with 5.2, 5.3, HEAD.




[2009-02-12 16:25:59] for-bugs at hnw dot jp

Sorry, reproduce code was incorrect. Correct code is below:


  int(0)
}
array(2) {
  [0]=>
  string(0) ""
  [1]=>
  string(1) "0"
}





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



#47376 [Opn->Bgs]: Segmentation fault in preg_replace on many repitition of pattern

2009-02-12 Thread felipe
 ID:   47376
 Updated by:   fel...@php.net
 Reported By:  pahan at hubbitus dot spb dot su
-Status:   Open
+Status:   Bogus
 Bug Type: PCRE related
 Operating System: Linux
 PHP Version:  5.3.0beta1
 New Comment:

It isn't a PHP bug.

See bug#33468, bug#39387.

Thanks.


Previous Comments:


[2009-02-12 22:51:08] pahan at hubbitus dot spb dot su

Sorry, sorry. Off course line "$text = file();" in reproduce code
unnecessary. Please remove it.



[2009-02-12 22:12:28] pahan at hubbitus dot spb dot su

Description:

On text, where search pattern repeated many times (>643 times by test)
php segfaulted (Core dump you may download here:
http://ru.bir.ru/_temp/php-pcre-bug/core.8729 ) on preg_replace.

So, if we reduce length of test text (
http://ru.bir.ru/_temp/php-pcre-bug/pcre_bug.text ) on 1 line, or just
limit repetition on 1 - it is worked.

All Zend-modules was disabled.

Reproduce code:
---


Expected result:

Work as when text is less.

Actual result:
--
Segmentation fault





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



#45922 [Opn->Fbk]: data is not transmitted throught pipes created by proc_open

2009-02-12 Thread jani
 ID:   45922
 Updated by:   j...@php.net
 Reported By:  TorokAlpar at Gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Streams related
 Operating System: *
 PHP Version:  5.2CVS-2008-08-27
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2008-12-18 22:49:56] scruoge at gmail dot com

PHP Version 5.2.6, Apache/2.0.63 Handler
Linux hostname 2.6.18-53.el5 #1 SMP Mon Nov 12 02:22:48 EST 2007 i686
I have exactly same bug. Script just silently dies.
here is the code:

 array("pipe", "r"),
   1 => array("pipe", "w"),
   2 => array("file", "/home/user/error-output.txt", "a")
);
$process = proc_open('/usr/local/bin/client', $desc, $pipes);
if (is_resource($process)) {
fwrite($pipes[0], $line);
fclose($pipes[0]);
$line = '';
while (($s = fgets($pipes[1], 1000)) !== false)
{
$s = trim($s, "\r\n");
$line.= $s;
if(strpos($s, '') !== false) break;
}
fclose($pipes[1]);
$return_value = proc_close($process);
}
$line = trim($line, "\r\n");
return $line;
}

echo test1('asdfasdf')."\n";

?>



[2008-08-27 08:56:20] TorokAlpar at Gmail dot com

I have tried with the latest snapshot, the result is the same



[2008-08-26 14:31:43] TorokAlpar at Gmail dot com

Description:

 After starting a program (Written in C) with proc_open the pipes
opened seem to be invalid. It looks like no data is transmitted over to
the childs stdin, On a read the script blocks.

Please bear with me, this is my firs bug report, and i am debugging
this for 7 hours now.

here are my modules: 

 [PHP Modules]
bcmath
calendar
com_dotnet
ctype
date
dom
domxml
exif
filter
ftp
gd
gettext
hash
iconv
imap
json
libxml
mbstring
mcrypt
mime_magic
ming
mssql
mysql
mysqli
odbc
paradox
pcre
pdf
PDO
pdo_mssql
pdo_mysql
ps
Reflection
session
SimpleXML
soap
sockets
SPL
SQLite
standard
tokenizer
wddx
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

[Zend Modules]
Xdebug

Note tha i also tried without Xdebug

Reproduce code:
---
$aDescriptorspec = array(
   0 => array("pipe", "r"),  // stdin is a pipe that
the child will read from
   1 => array("pipe", "w"),  // stdout is a pipe that
the child will write to
   2 => array("pipe", "w")   // stderr is a file to
write to
);
 $aOptions = array('bypass_shell' => true); // doesn't
influence the behavior 
 $rProcess = proc_open('F:\\checkpe-debug2.exe validpe',
$aDescriptorspec, $aPipes, null,null, $aOptions); 
 // $aPipes now looks like this:
 // 0 => writeable handle connected to child stdin
 // 1 => readable handle connected to child stdout   
 if (! is_resource($rProcess)) {

//   stream_set_write_buffer($aPipes[0], 0);
//fputs($aPipes[0],$sPath."\n",strlen($sPath)+1);
fwrite($aPipes[0],$sPath."\n");
//fflush($aPipes[0]);

sleep(1);   
$sResponse = fread($aPipes[1],2);
var_dump($sResponse);
 }   

/*
   NOTE : Commented lines don't influence the result if they are not
commented 
   The executable does work right, tested on the command line
   If you swap the executable with a php script that does the same
thing (reads in file paths separated with \n and writes 2 character
responses) everything functions as expected 
*/


Expected result:

var_dump  the 2 characters read from the output of the child

Actual result:
--
Script hangs , hang caused by the lien that reads: 

$sResponse = fread($aPipes[1],2);







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



#45971 [Opn->Fbk]: SimpleXMLElement does not overload properly

2009-02-12 Thread jani
 ID:   45971
 Updated by:   j...@php.net
 Reported By:  dennis at d23 dot nl
-Status:   Open
+Status:   Feedback
 Bug Type: SimpleXML related
 Operating System: *
 PHP Version:  5.2.6
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2008-09-02 09:56:51] dennis at d23 dot nl

Description:

When extending SimpleXMLElement the __get() and __set() methods of the
extending class do not get invoked. 
__call however works as expected.

Reproduce code:
---
');
// __set
$element->child1 = 1;
// __get
$element->child2;
// __call
$element->method();

?>

Expected result:

__set child1
__get child2
__call method

Actual result:
--
__call method





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



#46498 [Opn->Fbk]: is_writable() returns invalid result

2009-02-12 Thread jani
 ID:   46498
 Updated by:   j...@php.net
 Reported By:  registrace at koren dot cz
-Status:   Open
+Status:   Feedback
 Bug Type: Filesystem function related
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2008-11-05 21:01:31] registrace at koren dot cz

Description:

PHP Function is_writable() sometimes reports false results.

Requirements: Linux - getuid() != geteuid()

After inspection of PHP source, I realized, that is_writable()
internally uses syscall access(2). In turn,  access(2) man page (on
Linux) says:

   The check is done with the calling process’s real UID and 
GID,  rather
   than  with  the  effective  IDs  as is done when actually
attempting an
   operation.  This is to allow set-user-ID programs to  easily 
determine
   the invoking user’s authority.


Reproduce code:
---
";
echo "file is writable " .  (is_writable($file)?"TRUE":"FALSE") . "";

fopen("testfile.txt", 'wt');
echo ("file created");
?>


Expected result:

Expected result:

either: 
file is writable TRUE
file created

or
file is writable FALSE
ERROR



Actual result:
--
GetUID: 933/10099
file is writable FALSE
file created





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



#46481 [Opn->Fbk]: apache_lookup_uri() draws blank if Apache auth enabled

2009-02-12 Thread jani
 ID:   46481
 Updated by:   j...@php.net
 Reported By:  rosenfield dot albert at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Apache2 related
 Operating System: *
 PHP Version:  5CVS, 6CVS (2008-11-25)
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2008-11-05 11:13:31] rosenfield dot albert at gmail dot com

Yes sir!

Replaced PHP 5.2.6 with windows snapshot (5.2.7RC3-dev), but the
problem seems to persist.



[2008-11-04 13:45:49] rosenfield dot albert at gmail dot com

Description:

Using:
 $info = apache_lookup_uri($uri);

for a directory fx /test/, which happens to have an index.php file in
it.

Seems to work if there is no .htaccess file in the directory.

With this .htaccess file, apache_lookup_uri stops working:
=
# NT Domain Logins.
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
SSPIDomain 
SSPIOfferBasic On
SSPIOmitDomain On
AuthName "Webstatistics"
Require valid-user
=

Instead of an object, apache_lookup_uri just returns FALSE.


Reproduce code:
---
.htaccess:
# NT Domain Logins.
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
SSPIDomain 
SSPIOfferBasic On
SSPIOmitDomain On
AuthName "Webstatistics"
Require valid-user

index.php:
(anything)

PHP script to execute:
 $info = apache_lookup_uri($uri);

... where $uri is the virtual path where index.php and .htaccess
resides.


Expected result:

Object with information about the virtual path.


Actual result:
--
Nothing (FALSE).






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



#47364 [Opn->Bgs]: Problem with memory leaks in php5ts.dll PostPosted: Wed Feb 11, 2009 10:46 am

2009-02-12 Thread jani
 ID:   47364
 Updated by:   j...@php.net
 Reported By:  paras_shah2 at symantec dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Apache related
-Operating System: Windows 2k3, XP
+Operating System: win32 only - Windows 2k3, XP
 PHP Version:  5.2CVS-2009-02-12 (snap)
 New Comment:

Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.




Previous Comments:


[2009-02-12 05:15:08] paras_shah2 at symantec dot com

Description:

Hi ,

I have PHP (5.2.6) running as Apache module on apache web server 5.0.
We found memory leaks in
zend_read_static_property() and zend_hash_quick_add_or_update() as
number of clients increase from 100 to 300 etc.
Please find following readings for details.

I would like to know is anybody face memory leaks issues in
zend_read_static_property() and zend_hash_quick_add_or_update()
functions. If yes then what needs to be done to resolve this
issue.Please notes that as per my initial analysis it seems these
functions are part of php5ts.dll and this dll is initialized and load by
php.exe.

I would be grateful to you if you could answer my query as early as
possible.Please reply earliest.

Thanks,
Paras

300 Client Log Excerpt: ( Test ran with php.ini changes -
session.gc_maxlifetime = 20 mins, memory_limit = 10MB)

1. zend_read_static_property() method allocates ~70MB
+ 70516736 ( 70778880 - 262144) 270 allocs BackTrace51D
+ 269 ( 270 - 1) BackTrace51D allocations

ntdll!RtlAllocateHeapSlowly+0041
ntdll!RtlAllocateHeap+0E9F
php5ts!zend_read_static_property+00E5
php5ts!zend_mm_shutdown+0102





2. zend_hash_quick_add_or_update() method allocates ~54MB



+ 54264832 ( 54572964 - 308132) 635465 allocs BackTrace3F1
+ 632150 ( 635465 - 3315) BackTrace3F1 allocations



ntdll!RtlAllocateHeapSlowly+0041
ntdll!RtlAllocateHeap+0E9F
msvcrt!malloc+006C
php5ts!zend_hash_quick_add_or_update+0261





100 Client Log Excerpt:( Test ran without php.ini,
session.gc_maxlifetime = 30 days, memory_limit= not set, i.e., PHP
default 128MB is set)



1. zend_read_static_property() method allocates ~3MB
+ 3407872 ( 3670016 - 262144) 14 allocs BackTrace51D
+ 13 ( 14 - 1) BackTrace51D allocations
ntdll!RtlAllocateHeapSlowly+0041
ntdll!RtlAllocateHeap+0E9F
php5ts!zend_read_static_property+00E5
php5ts!zend_mm_shutdown+0102



2. zend_hash_quick_add_or_update() method allocates ~4MB
+ 4459436 ( 4767568 - 308132) 55168 allocs BackTrace3F1
+ 51853 ( 55168 - 3315) BackTrace3F1 allocations

ntdll!RtlAllocateHeapSlowly+0041
ntdll!RtlAllocateHeap+0E9F
msvcrt!malloc+006C
php5ts!zend_hash_quick_add_or_update+0261

Reproduce code:
---
This reproduccible through performance tool






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



#47376 [Com]: Segmentation fault in preg_replace on many repitition of pattern

2009-02-12 Thread pahan at hubbitus dot spb dot su
 ID:   47376
 Comment by:   pahan at hubbitus dot spb dot su
 Reported By:  pahan at hubbitus dot spb dot su
 Status:   Open
 Bug Type: PCRE related
 Operating System: Linux
 PHP Version:  5.3.0beta1
 New Comment:

Sorry, sorry. Off course line "$text = file();" in reproduce code
unnecessary. Please remove it.


Previous Comments:


[2009-02-12 22:12:28] pahan at hubbitus dot spb dot su

Description:

On text, where search pattern repeated many times (>643 times by test)
php segfaulted (Core dump you may download here:
http://ru.bir.ru/_temp/php-pcre-bug/core.8729 ) on preg_replace.

So, if we reduce length of test text (
http://ru.bir.ru/_temp/php-pcre-bug/pcre_bug.text ) on 1 line, or just
limit repetition on 1 - it is worked.

All Zend-modules was disabled.

Reproduce code:
---


Expected result:

Work as when text is less.

Actual result:
--
Segmentation fault





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



#47376 [NEW]: Segmentation fault in preg_replace on many repitition of pattern

2009-02-12 Thread pahan at hubbitus dot spb dot su
From: pahan at hubbitus dot spb dot su
Operating system: Linux
PHP version:  5.3.0beta1
PHP Bug Type: PCRE related
Bug description:  Segmentation fault in preg_replace on many repitition of 
pattern

Description:

On text, where search pattern repeated many times (>643 times by test) php
segfaulted (Core dump you may download here:
http://ru.bir.ru/_temp/php-pcre-bug/core.8729 ) on preg_replace.

So, if we reduce length of test text (
http://ru.bir.ru/_temp/php-pcre-bug/pcre_bug.text ) on 1 line, or just
limit repetition on 1 - it is worked.

All Zend-modules was disabled.

Reproduce code:
---


Expected result:

Work as when text is less.

Actual result:
--
Segmentation fault

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



#47375 [Opn]: Compilation fails with error of symbol __yytext

2009-02-12 Thread jpcaissy at envolee dot com
 ID:   47375
 User updated by:  jpcaissy at envolee dot com
 Reported By:  jpcaissy at envolee dot com
 Status:   Open
 Bug Type: Compile Failure
 Operating System: Mac OS X 10.4.11 Server
 PHP Version:  5.2CVS-2009-02-12 (snap)
 New Comment:

Please note the --enable-embed


Previous Comments:


[2009-02-12 20:41:56] jpcaissy at envolee dot com

Description:

When trying to compile, it fails returning :

Reproduce code:
---
CFLAGS="-O3" ./configure '--prefix=/opt/local'
'--mandir=/opt/local/share/man' '--infodir=/opt/local/share/info'
'--with-config-file-path=/opt/local/etc' '--enable-calendar'
'--with-iconv=/opt/local' '--enable-exif' '--enable-ftp' '--enable-wddx'
'--with-zlib=/opt/local' '--with-bz2=/opt/local'
'--with-libxml-dir=/opt/local' '--with-gettext=/opt/local' '--with-xml'
'--with-libexpat-dir=/opt/local' '--with-xmlrpc' '--enable-soap'
'--enable-bcmath' '--enable-mbstring' '--enable-dba' '--enable-zip'
'--with-openssl=/opt/local' '--with-mhash=/opt/local'
'--with-mcrypt=/opt/local' '--with-mime-magic' '--with-xsl=/opt/local'
'--with-curl=/opt/local' '--with-pcre-regex=/opt/local' '--with-gd'
'--with-jpeg-dir=/opt/local' '--with-png-dir=/opt/local'
'--enable-gd-native-ttf' '--with-freetype-dir=/opt/local'
'--with-ldap=/usr' '--with-kerberos=/usr' '--with-iodbc=/usr'
'--with-apxs=/usr/sbin/apxs' '--with-gmp=/opt/local'
'--with-imap=/opt/local' '--with-imap-ssl=/opt/local'
'--with-pspell=/opt/local' '--with-snmp=/usr'
'--with-mysql=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_www_php5/work/mysql5'
'--with-pdo-mysql=/opt/local/bin/mysql_config5'
'--with-mysql-sock=/opt/local/var/run/mysql5/mysqld.sock'
'--with-mysqli=/opt/local/bin/mysql_config5' '--with-sqlite'
'--with-pdo-sqlite=/opt/local' '--enable-sqlite-utf8' '--enable-shmop'
'--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg'
'--with-pear=/opt/local/lib/php' '--with-readline=/opt/local'
'--enable-sockets' '--enable-embed'
make install

Expected result:

To compile

Actual result:
--
/usr/bin/ld: multiple definitions of symbol _yytext
Zend/.libs/zend_language_scanner.o definition of _yytext in section
(__DATA,__common)
Zend/.libs/zend_ini_scanner.o definition of _yytext in section
(__DATA,__common)
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1





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



#47375 [NEW]: Compilation fails with error of symbol __yytext

2009-02-12 Thread jpcaissy at envolee dot com
From: jpcaissy at envolee dot com
Operating system: Mac OS X 10.4.11 Server
PHP version:  5.2CVS-2009-02-12 (snap)
PHP Bug Type: Compile Failure
Bug description:  Compilation fails with error of symbol __yytext

Description:

When trying to compile, it fails returning :

Reproduce code:
---
CFLAGS="-O3" ./configure '--prefix=/opt/local'
'--mandir=/opt/local/share/man' '--infodir=/opt/local/share/info'
'--with-config-file-path=/opt/local/etc' '--enable-calendar'
'--with-iconv=/opt/local' '--enable-exif' '--enable-ftp' '--enable-wddx'
'--with-zlib=/opt/local' '--with-bz2=/opt/local'
'--with-libxml-dir=/opt/local' '--with-gettext=/opt/local' '--with-xml'
'--with-libexpat-dir=/opt/local' '--with-xmlrpc' '--enable-soap'
'--enable-bcmath' '--enable-mbstring' '--enable-dba' '--enable-zip'
'--with-openssl=/opt/local' '--with-mhash=/opt/local'
'--with-mcrypt=/opt/local' '--with-mime-magic' '--with-xsl=/opt/local'
'--with-curl=/opt/local' '--with-pcre-regex=/opt/local' '--with-gd'
'--with-jpeg-dir=/opt/local' '--with-png-dir=/opt/local'
'--enable-gd-native-ttf' '--with-freetype-dir=/opt/local'
'--with-ldap=/usr' '--with-kerberos=/usr' '--with-iodbc=/usr'
'--with-apxs=/usr/sbin/apxs' '--with-gmp=/opt/local'
'--with-imap=/opt/local' '--with-imap-ssl=/opt/local'
'--with-pspell=/opt/local' '--with-snmp=/usr'
'--with-mysql=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_www_php5/work/mysql5'
'--with-pdo-mysql=/opt/local/bin/mysql_config5'
'--with-mysql-sock=/opt/local/var/run/mysql5/mysqld.sock'
'--with-mysqli=/opt/local/bin/mysql_config5' '--with-sqlite'
'--with-pdo-sqlite=/opt/local' '--enable-sqlite-utf8' '--enable-shmop'
'--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg'
'--with-pear=/opt/local/lib/php' '--with-readline=/opt/local'
'--enable-sockets' '--enable-embed'
make install

Expected result:

To compile

Actual result:
--
/usr/bin/ld: multiple definitions of symbol _yytext
Zend/.libs/zend_language_scanner.o definition of _yytext in section
(__DATA,__common)
Zend/.libs/zend_ini_scanner.o definition of _yytext in section
(__DATA,__common)
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1

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



#47373 [Opn->Fbk]: imap_headerinfo crash from field

2009-02-12 Thread pajoye
 ID:   47373
 Updated by:   paj...@php.net
 Reported By:  joao dot alfredo at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: IMAP related
 Operating System: ubuntu 8.10
 PHP Version:  5.2CVS-2009-02-12 (CVS)
 New Comment:

Which imap version do you use?


Previous Comments:


[2009-02-12 19:44:23] joao dot alfredo at gmail dot com

Description:

imap_headerinfo crash on trying get the header of a message with a
huge(100Kb) FROM field.

Reproduce code:
---
$header = imap_headerinfo($connection, 20);

Expected result:

Warning: imap_headerinfo(): To length must be less than or equal to %d
bytes
bool(false)


Actual result:
--
PHP Crash





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



#47373 [NEW]: imap_headerinfo crash from field

2009-02-12 Thread joao dot alfredo at gmail dot com
From: joao dot alfredo at gmail dot com
Operating system: ubuntu 8.10
PHP version:  5.2CVS-2009-02-12 (CVS)
PHP Bug Type: IMAP related
Bug description:  imap_headerinfo crash from field

Description:

imap_headerinfo crash on trying get the header of a message with a
huge(100Kb) FROM field.

Reproduce code:
---
$header = imap_headerinfo($connection, 20);

Expected result:

Warning: imap_headerinfo(): To length must be less than or equal to %d
bytes
bool(false)


Actual result:
--
PHP Crash

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



#47370 [Ver->Fbk]: array_unique has backward compatibility problem, and SORT_REGULAR is confusing

2009-02-12 Thread moriyoshi
 ID:   47370
 Updated by:   moriyo...@php.net
 Reported By:  for-bugs at hnw dot jp
-Status:   Verified
+Status:   Feedback
 Bug Type: Arrays related
 Operating System: any
 PHP Version:  5.2.9RC1
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2009-02-12 18:12:35] moriyo...@php.net

Verified with 5.2, 5.3, HEAD.




[2009-02-12 16:25:59] for-bugs at hnw dot jp

Sorry, reproduce code was incorrect. Correct code is below:


  int(0)
}
array(2) {
  [0]=>
  string(0) ""
  [1]=>
  string(1) "0"
}





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



#47368 [Opn->Bgs]: XMLWriter::writeAttribute() doesn't display accented characters

2009-02-12 Thread rrichards
 ID:   47368
 Updated by:   rricha...@php.net
 Reported By:  christian dot ubu at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: XML Writer
 Operating System: CentOS release 5.2 (Final)
 PHP Version:  5.2CVS-2009-02-12 (CVS)
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

certain characters get written as character references within attribute

values. That happens to one of them. Also make sure your encodings are

correct because when run within UTF-8 env, the output is:

which is correct


Previous Comments:


[2009-02-12 12:32:22] christian dot ubu at gmail dot com

Description:

XMLWriter::writeAttribute() doesn't display the value of the attribute
with accented characters.

Reproduce code:
---
openURI('php://output');
$w->startElement('test');
$w->writeAttribute('testé', 'testé');
$w->endElement();
$w->outputMemory();

?>

Expected result:



Actual result:
--






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



#47370 [Opn->Ver]: array_unique has backward compatibility problem, and SORT_REGULAR is confusing

2009-02-12 Thread moriyoshi
 ID:   47370
 Updated by:   moriyo...@php.net
 Reported By:  for-bugs at hnw dot jp
-Status:   Open
+Status:   Verified
 Bug Type: Arrays related
 Operating System: any
 PHP Version:  5.2.9RC1
 New Comment:

Verified with 5.2, 5.3, HEAD.



Previous Comments:


[2009-02-12 16:25:59] for-bugs at hnw dot jp

Sorry, reproduce code was incorrect. Correct code is below:


  int(0)
}
array(2) {
  [0]=>
  string(0) ""
  [1]=>
  string(1) "0"
}





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



#46478 [Ana->Asn]: htmlentities() uses obsolete mapping table for character entity references

2009-02-12 Thread moriyoshi
 ID:   46478
 Updated by:   moriyo...@php.net
 Reported By:  for-bugs at hnw dot jp
-Status:   Analyzed
+Status:   Assigned
 Bug Type: Feature/Change Request
 Operating System: *
 PHP Version:  5.2.6
 Assigned To:  moriyoshi


Previous Comments:


[2008-11-09 16:39:06] moriyo...@php.net

I think this is a bug, but correcting the table should break BC too. 



[2008-11-04 12:56:40] for-bugs at hnw dot jp

Description:

ext/standard/html.c has incorrect mapping table which htmlentities()
uses.

html.c is based on
http://www.unicode.org/Public/MAPPINGS/OBSOLETE/UNI2SGML.TXT, but this
mapping table is obsolete and not compatible with HTML4.0 or XHTML1.0.
For example, U+2235(which is encoded to "\xe2\x88\xb5" with UTF-8) is
not in http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent, but
htmlentities() returns "∵".

U+226A(≪) and U+226B(≫) are similler case.

Reproduce code:
---
http://bugs.php.net/?id=46478&edit=1



#42757 [Com]: Mysql doesn't load php_mysql.dll

2009-02-12 Thread jcanto at megamedia dot com dot mx
 ID:   42757
 Comment by:   jcanto at megamedia dot com dot mx
 Reported By:  nektarin at gmail dot com
 Status:   No Feedback
 Bug Type: MySQL related
 Operating System: Win XP
 PHP Version:  5.2.4
 New Comment:

Just change the DLL order in your php.ini, put php_mysql.dll before any
other database.dll (ex. before php_mssql.dll).


Previous Comments:


[2008-04-24 15:36:27] abang_tukang_sayur at yahoo dot com

same problem occured when i upgrade my PHP 5.2.1 into 5.2.5 i try to
use php_mysql.dll from the older PHP 5.2.1 but get this message when i
tried to use mysql_connect() function:

bad handshake.

so is there any suggestion to my problem? it's very frustrating. thx
b4.



[2007-10-04 01:00:00] 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".



[2007-09-27 04:32:13] raiko at akubi dot de

>From your phpinfo page what does "Client API version" for MySQL show?
>
>The MySQL extension for PHP is compiled against 5.0.45, if you have
an
>older libmysql.dll in your path then it will try to use that.

Thanks for the hint, you were right.

Apparently, there was an old version of libmysql.dll left in the
system32 directory (ver. 4.1.x). After replacing it with the an
up-to-date version everything works fine with the 5.2.5 php_mysql.dll .



[2007-09-27 00:06:26] scott...@php.net

>From your phpinfo page what does "Client API version" for MySQL show?

The MySQL extension for PHP is compiled against 5.0.45, if you have an
older libmysql.dll in your path then it will try to use that.





[2007-09-26 22:30:06] raiko at akubi dot de

The same bug occured when I upgraded from 5.2.2 to 5.2.4 earlier.

The error message I got in the error.log was:

---
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\Server\\php\\ext\\php_mysql.dll' - Die angegebene Prozedur wurde
nicht gefunden.\r\n in Unknown on line 0
---

Using the DLL from the snapshot link that was posted did not fix it.

Replacing the DLL with the 5.2.2 version fixed it, the server starts
normally and all MySQL functions work properly.



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/42757

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



#47370 [Opn]: array_unique has backward compatibility problem, and SORT_REGULAR is confusing

2009-02-12 Thread for-bugs at hnw dot jp
 ID:   47370
 User updated by:  for-bugs at hnw dot jp
 Reported By:  for-bugs at hnw dot jp
 Status:   Open
 Bug Type: Arrays related
 Operating System: any
 PHP Version:  5.2.9RC1
 New Comment:

Sorry, reproduce code was incorrect. Correct code is below:


  int(0)
}
array(2) {
  [0]=>
  string(0) ""
  [1]=>
  string(1) "0"
}





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



#47370 [NEW]: array_unique has backward compatibility problem, and SORT_REGULAR is confusing

2009-02-12 Thread for-bugs at hnw dot jp
From: for-bugs at hnw dot jp
Operating system: any
PHP version:  5.2.9RC1
PHP Bug Type: Arrays related
Bug description:  array_unique has backward compatibility problem, and 
SORT_REGULAR is confusing

Description:

In PHP5.2.9RC1, array_unique() returns different result because of element
ordering in array. Reproduce code shows this difference.

It is because SORT_REGULAR never cast array elements and compares them
with ==. I think it's better for SORT_REGULAR to compare elements by using
=== instead of ==.

PHP 5.2.9RC1's array_unique() also has backward compatibility ploblem.
Considering backward compatibility, default sort_flag should be
SORT_STRING.

Reproduce code:
---

  int(0)
}
array(2) {
  [0]=>
  string(0) ""
  [1]=>
  string(1) "0"
}

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



#47363 [Opn->Bgs]: for($i=4;$i<((func_num_args() + sizeof($array)));$i++) does not work.

2009-02-12 Thread scottmac
 ID:   47363
 Updated by:   scott...@php.net
 Reported By:  devilx at devilx dot net
-Status:   Open
+Status:   Bogus
 Bug Type: Arrays related
 Operating System: Linux, Mac OS X
 PHP Version:  5.2.9RC1
 New Comment:

The condition is evaluated at the start of each iteration.

Also moving the calculation above the loop works.


Previous Comments:


[2009-02-12 14:33:50] smlerman at gmail dot com

Try checking the value of sizeof($wuergs) inside the loop. Hint: it
changes every time.



[2009-02-12 04:15:07] devilx at devilx dot net

Description:

The Calculation of sizeof + func_num_args within a for does not work /

ends in an endless-for.

Reproduce code:
---
f("this","is","a","test");

function f()
{
   $wuergs = array (
0 => "1234",
1 => "B",
2 => "C",
3 => "D"
);

$args=func_get_args();
for($i=4;$i<((func_num_args() + sizeof($wuergs)));$i++)
{
$wuergs[$i]=$args[$i-4];
}
return l_backend($wuergs);
}

Expected result:

Moving the content of $args four arrays highr.

Actual result:
--
Endless loop.





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



#47363 [Com]: for($i=4;$i<((func_num_args() + sizeof($array)));$i++) does not work.

2009-02-12 Thread smlerman at gmail dot com
 ID:   47363
 Comment by:   smlerman at gmail dot com
 Reported By:  devilx at devilx dot net
 Status:   Open
 Bug Type: Arrays related
 Operating System: Linux, Mac OS X
 PHP Version:  5.2.9RC1
 New Comment:

Try checking the value of sizeof($wuergs) inside the loop. Hint: it
changes every time.


Previous Comments:


[2009-02-12 04:15:07] devilx at devilx dot net

Description:

The Calculation of sizeof + func_num_args within a for does not work /

ends in an endless-for.

Reproduce code:
---
f("this","is","a","test");

function f()
{
   $wuergs = array (
0 => "1234",
1 => "B",
2 => "C",
3 => "D"
);

$args=func_get_args();
for($i=4;$i<((func_num_args() + sizeof($wuergs)));$i++)
{
$wuergs[$i]=$args[$i-4];
}
return l_backend($wuergs);
}

Expected result:

Moving the content of $args four arrays highr.

Actual result:
--
Endless loop.





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



#47293 [Bgs]: Running Configure getting an error

2009-02-12 Thread martinf at ca dot ibm dot com
 ID:   47293
 User updated by:  martinf at ca dot ibm dot com
 Reported By:  martinf at ca dot ibm dot com
 Status:   Bogus
 Bug Type: PHP options/info functions
 Operating System: Linux Redhat 4
 PHP Version:  5.2.8
 New Comment:

Since I havent seen any reply I fooled around with the error and went
ahead to 'make install'.  It looks like the failed test was a part of
the testing process and to send email to qa-repo...@lists.php.net was
optional.

I wish when making test, would mention about it as I am new to PHP.

Whoever is tracking it, please close it.

Thanks.


Previous Comments:


[2009-02-04 13:41:13] martinf at ca dot ibm dot com

Hi,
Thanks for the response, I have used the following syntax:

./configure --prefix=/usr/local/php-5.2.8
--with-mysqli=/usr/bin/mysql_config
--with-apxs2=/usr/local/apache-2.2.11/bin/apxs --with-ldap
--enable-mbstring --enable-shmop --enable-xml --with-zlib

The configure and 'make' went well this time.

During the 'make test', it came back with these:
=
TEST RESULT SUMMARY
-
Exts skipped:   52
Exts tested :   27
-

Number of tests : 6673  4958
Tests borked:1 (  0.0%) 
Tests skipped   : 1714 ( 25.7%) 
Tests warned:3 (  0.0%) (  0.1%)
Tests failed:   10 (  0.1%) (  0.2%)
Expected fail   :4 (  0.1%) (  0.1%)
Tests passed: 4941 ( 74.0%) ( 99.7%)
-
Time taken  :  178 seconds
=

Do I really need to send it to qa-repo...@lists.php.net as it said at
the end for the txt file?

Can I run 'make install' and proceed even with errors? or the test are
supposed to fail?

Please advice.



[2009-02-03 22:11:19] j...@php.net

This might help:

# ./configure --help |grep xml 

It's --enable-xml like it has always been..



[2009-02-03 21:37:48] martinf at ca dot ibm dot com

I was playing even with the error message about no such option of
--with-xml and did a compile which went ok, but the make test came back
with failures and asking me to mail the txt file to
qa-repo...@lists.php.net.

Here is the summary of the make test:
=
TEST RESULT SUMMARY
-
Exts skipped:   52
Exts tested :   27
-

Number of tests : 6673  4958
Tests borked:1 (  0.0%) 
Tests skipped   : 1714 ( 25.7%) 
Tests warned:3 (  0.0%) (  0.1%)
Tests failed:   10 (  0.1%) (  0.2%)
Expected fail   :4 (  0.1%) (  0.1%)
Tests passed: 4941 ( 74.0%) ( 99.7%)
-
Time taken  :  178 seconds
=

My question is, should i skip the --with-xml and proceed with the make
test?  even there are failures and asking me to submit the txt report,
can I just 'make install' and install just like that? Would it work or
am I missing something?  Sorry I am new with PHP and would like some
advice to proceed.  Thanks in advance.



[2009-02-03 18:57:24] martinf at ca dot ibm dot com

Description:

I am trying to install PHP 5.2.8 but getting an error after executing
the ./configure command.

Is --with-xml no longer an option?  I used the ./configure --help and
couldnt locate for it.  I am trying to install IBM Rational BuildForge
and one section asked me to install PHP 5.2.1 but I thought 5.2.8 is the
newest version so used it.  I did google PHP configure issue --with-xml
and zero result of the issue I am having.
I did see someone posted a different issue and used the --with-xml
option.

Or --with-xml only available with 5.2.1?

Please advice.


Reproduce code:
---
./configure --prefix=/usr/local/php-5.2.8
--with-mysqli=/usr/bin/mysql_config
--with-apxs2=/usr/local/apache-2.2.11/bin/apxs --with-ldap
--enable-mbstring --enable-shmop --with-xml --with-zlib

Actual result:
--
It ran all the way without complain til the end:

Thank you for using PHP.

Notice: Following unknown configure options were used:

--with-xml

Check './configure --help' for available options




-

#47365 [Opn->Fbk]: ip2long: 32bis vs. 64bit!

2009-02-12 Thread dsp
 ID:   47365
 Updated by:   d...@php.net
 Reported By:  flobee at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: *Network Functions
 Operating System: SunOS
 PHP Version:  5.2.9RC1
 New Comment:

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


Which Solaris Version. Solaris 10. On Sparc or on x86?

On OpenSolaris x86 64 bit it returns false as expected:

~/> php -r "var_dump(ip2long('web.de'));"  
   
bool(false)
~/> isainfo -b 
   
64
~/> uname -a   
   
SunOS Stanford 5.11 snv_106 i86pc i386 i86pc Solaris
~/> php -v 
   
PHP 5.2.6 (cli) (built: Jan 28 2009 01:43:42) (DEBUG)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies



Previous Comments:


[2009-02-12 09:27:18] flobee at gmail dot com

Description:

ip2long seems to be buggy on 64 Bit Solaris:
Tested with: php5.2.2, php5.2.8



Reproduce code:
---
64bit Solaris
#php -r "echo 'x:' . ip2long('web.de') .\"\n\";"
// x:4294967295

32bit Solaris
#php -r "echo 'x:' . ip2long('web.de') .\"\n\";"
// x:false







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



#47368 [NEW]: XMLWriter::writeAttribute() doesn't display accented characters

2009-02-12 Thread christian dot ubu at gmail dot com
From: christian dot ubu at gmail dot com
Operating system: CentOS release 5.2 (Final)
PHP version:  5.2CVS-2009-02-12 (CVS)
PHP Bug Type: XML Writer
Bug description:  XMLWriter::writeAttribute() doesn't display accented 
characters

Description:

XMLWriter::writeAttribute() doesn't display the value of the attribute
with accented characters.

Reproduce code:
---
openURI('php://output');
$w->startElement('test');
$w->writeAttribute('testé', 'testé');
$w->endElement();
$w->outputMemory();

?>

Expected result:



Actual result:
--


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



#47358 [Bgs]: glob returns error, should be empty array()

2009-02-12 Thread php at guggemand dot dk
 ID:   47358
 User updated by:  php at guggemand dot dk
 Reported By:  php at guggemand dot dk
 Status:   Bogus
 Bug Type: Safe Mode/open_basedir
 Operating System: FreeBSD 7.1
 PHP Version:  5.2.9RC1
 New Comment:

"an empty array if no file matched" is what i see in the manual.
but this returns error, and not an empty array()

glob("/path/allowd/in/open_basedir/nonexitentfile.*"); 

I can understand why a system glob call returning no files, and a call
returning only nonallowed files has to be treated the same.

But im to dumb to see the logic in treating both as errors instead of
"no files matched", especially because that breaks existing code.
And treating it as "no files matched" doesnt break anything.
Please enlighten me if im wrong, and ill put on my pointy hat and sit
in the corner for the rest of the day.

But now i have link i can give the users telling me my servers doesn't
work right. So i guess i can live with that.


Previous Comments:


[2009-02-11 14:20:51] il...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The function is documented to return FALSE on error. There is no
problem 
here...



[2009-02-11 08:12:10] php at guggemand dot dk

Description:

glob() cant be used directly in foreach when open_basedir is set.

i found #41655 which is about the change causing this, and a few other
closed tickets with "not a bug" as answer.

But that change destroys foreach(glob("nonexistent*") as ... when using
open_basedir, and the following comment in dir.c states that should be
usable.

/* Some glob implementation simply return no data if no matches
   were found, others return the GLOB_NOMATCH error code.
   We don't want to treat GLOB_NOMATCH as an error condition
   so that PHP glob() behaves the same on both types of
   implementations and so that 'foreach (glob() as ...'
   can be used for simple glob() calls without further error
   checking.
*/

As far as i can tell the right thing to do would be to return an empty
array both when using glob("/etc/hosts") and glob("/etc/nonexistent")
when open_basedir is used. Or what am i missing?

Ive been using the following patch, and as far as i can tell its not
possible to check if a file exists when open_basedir is used, and
foreach(glob("nonext*")) works correctly.

http://gugge.dlx.dk/ting/php5-patch-dir.c

Reproduce code:
---
set open_basedir /documentroot

open /documentroot/test.php with the following content




Expected result:

array(0) {
}


Actual result:
--
bool(false) 





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



#47367 [Opn]: segfault when connecting while unbuffered query is running

2009-02-12 Thread Sjon at react dot nl
 ID:   47367
 User updated by:  Sjon at react dot nl
 Reported By:  Sjon at react dot nl
 Status:   Open
-Bug Type: *General Issues
+Bug Type: MySQL related
 Operating System: Linux
 PHP Version:  5.2.9RC1
 New Comment:

Category -> MySQL


Previous Comments:


[2009-02-12 10:10:45] Sjon at react dot nl

Description:

PHP Segfaults when establishing a second connection when an unbuffered
query is running

Since I cannot report a bug in 5.2.8; I compiled php5.2-200902120730
and reproduced the bug with that version

$ ./configure --with-mysql=shared
$ make
$ ./sapi/cli/php -v

PHP 5.2.9RC2-dev (cli) (built: Feb 12 2009 10:52:08) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

$ ./sapi/cli/php -n -d extension_dir=./modules/ -d extension=mysql.so
mysql-unbuffered-crash.php

Reproduce code:
---

  string(4) "asdf"
}
SUCCESS

Actual result:
--
array(1) {
  ["data"]=>
  string(4) "asdf"
}
SUCCESS

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7d4f6c0 (LWP 21345)]
zend_mm_add_to_free_list (heap=,
mm_block=0x9ee4e30)
at /tmp/php5.2-200902120730/Zend/zend_alloc.c:747
747 if (ZEND_MM_FREE_BLOCK_SIZE(prev) != 
size) {
(gdb) bt
#0  zend_mm_add_to_free_list (heap=,
mm_block=0x9ee4e30)
at /tmp/php5.2-200902120730/Zend/zend_alloc.c:747
#1  0x0826790b in _zend_mm_free_int (heap=0x9e2c1e8, p=)
at /tmp/php5.2-200902120730/Zend/zend_alloc.c:1987
#2  0x08277445 in shutdown_executor ()
at /tmp/php5.2-200902120730/Zend/zend_execute_API.c:283
#3  0x08281aa3 in zend_deactivate ()
at /tmp/php5.2-200902120730/Zend/zend.c:860
#4  0x08240857 in php_request_shutdown (dummy=0x0)
at /tmp/php5.2-200902120730/main/main.c:1492
#5  0x082ecd71 in main (argc=7, argv=0xbf9c1a44)
at /tmp/php5.2-200902120730/sapi/cli/php_cli.c:1314





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



#47367 [NEW]: segfault when connecting while unbuffered query is running

2009-02-12 Thread Sjon at react dot nl
From: Sjon at react dot nl
Operating system: Linux
PHP version:  5.2.9RC1
PHP Bug Type: *General Issues
Bug description:  segfault when connecting while unbuffered query is running

Description:

PHP Segfaults when establishing a second connection when an unbuffered
query is running

Since I cannot report a bug in 5.2.8; I compiled php5.2-200902120730 and
reproduced the bug with that version

$ ./configure --with-mysql=shared
$ make
$ ./sapi/cli/php -v

PHP 5.2.9RC2-dev (cli) (built: Feb 12 2009 10:52:08) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

$ ./sapi/cli/php -n -d extension_dir=./modules/ -d extension=mysql.so
mysql-unbuffered-crash.php

Reproduce code:
---

  string(4) "asdf"
}
SUCCESS

Actual result:
--
array(1) {
  ["data"]=>
  string(4) "asdf"
}
SUCCESS

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7d4f6c0 (LWP 21345)]
zend_mm_add_to_free_list (heap=, mm_block=0x9ee4e30)
at /tmp/php5.2-200902120730/Zend/zend_alloc.c:747
747 if (ZEND_MM_FREE_BLOCK_SIZE(prev) != 
size) {
(gdb) bt
#0  zend_mm_add_to_free_list (heap=,
mm_block=0x9ee4e30)
at /tmp/php5.2-200902120730/Zend/zend_alloc.c:747
#1  0x0826790b in _zend_mm_free_int (heap=0x9e2c1e8, p=)
at /tmp/php5.2-200902120730/Zend/zend_alloc.c:1987
#2  0x08277445 in shutdown_executor ()
at /tmp/php5.2-200902120730/Zend/zend_execute_API.c:283
#3  0x08281aa3 in zend_deactivate ()
at /tmp/php5.2-200902120730/Zend/zend.c:860
#4  0x08240857 in php_request_shutdown (dummy=0x0)
at /tmp/php5.2-200902120730/main/main.c:1492
#5  0x082ecd71 in main (argc=7, argv=0xbf9c1a44)
at /tmp/php5.2-200902120730/sapi/cli/php_cli.c:1314

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



#47366 [Com]: mb_convert_encoding converts some symbols incorrectly from EUC-JP to UTF-8

2009-02-12 Thread max at injapan dot ru
 ID:   47366
 Comment by:   max at injapan dot ru
 Reported By:  max at injapan dot ru
 Status:   Open
 Bug Type: mbstring related
 Operating System: CentOS 5.2
 PHP Version:  5.3CVS-2009-02-12 (snap)
 New Comment:

Text in "Expected result" field is messed a little: of course, 
expected output is just one character U+2161.


Previous Comments:


[2009-02-12 10:04:11] max at injapan dot ru

Description:

mb_convert_encoding converts symbols \xAD\xB5-\xAD\xBF  incorrectly 
from EUC-JP to UTF-8. It's possible that some other symbols converted 
incorrectly too, but I have no possibility to check it to full 
extent.

Unicode has corresponding codepoints, i.e. U+2161 for Ⅱ.

Majority of EUC-JP texts is converted mormally.

Reproduce code:
---
echo mb_convert_encoding("\xAD\xB6", "UTF-8", "EUC-JP");

Expected result:

string «Ⅱ» (U+2161)
printed to STDOUT

Actual result:
--
string «?»
printed to STDOUT





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



#47366 [NEW]: mb_convert_encoding converts some symbols incorrectly from EUC-JP to UTF-8

2009-02-12 Thread max at injapan dot ru
From: max at injapan dot ru
Operating system: CentOS 5.2
PHP version:  5.3CVS-2009-02-12 (snap)
PHP Bug Type: mbstring related
Bug description:  mb_convert_encoding converts some symbols incorrectly from 
EUC-JP to UTF-8

Description:

mb_convert_encoding converts symbols \xAD\xB5-\xAD\xBF  incorrectly 
from EUC-JP to UTF-8. It's possible that some other symbols converted 
incorrectly too, but I have no possibility to check it to full 
extent.

Unicode has corresponding codepoints, i.e. U+2161 for Ⅱ.

Majority of EUC-JP texts is converted mormally.

Reproduce code:
---
echo mb_convert_encoding("\xAD\xB6", "UTF-8", "EUC-JP");

Expected result:

string «Ⅱ» (U+2161)
printed to STDOUT

Actual result:
--
string «?»
printed to STDOUT

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



#47365 [NEW]: ip2long: 32bis vs. 64bit!

2009-02-12 Thread flobee at gmail dot com
From: flobee at gmail dot com
Operating system: SunOS
PHP version:  5.2.9RC1
PHP Bug Type: *Network Functions
Bug description:  ip2long: 32bis vs. 64bit!

Description:

ip2long seems to be buggy on 64 Bit Solaris:
Tested with: php5.2.2, php5.2.8



Reproduce code:
---
64bit Solaris
#php -r "echo 'x:' . ip2long('web.de') .\"\n\";"
// x:4294967295

32bit Solaris
#php -r "echo 'x:' . ip2long('web.de') .\"\n\";"
// x:false



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