#49369 [NEW]: make current(),key(),next() etc. check for Iterator

2009-08-26 Thread admin at ifyouwantblood dot de
From: admin at ifyouwantblood dot de
Operating system: 
PHP version:  5.3.0
PHP Bug Type: Feature/Change Request
Bug description:  make current(),key(),next() etc. check for Iterator

Description:

it would be helpful for chained Iterators, if the default array functions
would check if an given object is an instanceof Iterator and react
appropriate.

thus key() calling object->key(), current() calling object->current() and
so on.

Reproduce code:
---
aarray=$array;
}

public function key()
{
return key($this->aarray);
}

public function current()
{
return current($this->aarray);
}

public function valid()
{
return (current($this->aarray)!==FALSE);
}

public function next()
{
next($this->aarray);
}

public function rewind()
{
reset($this->aarray);
}
}

$i=new iterator_array(Array(1,2));
var_dump(current($i));
var_dump(key($i));
next($i);
var_dump($current($i));
var_dump(key($i));

Expected result:

int(1)
int(0)
int(2)
int(1)


Actual result:
--
array(6) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
  [3]=>
  int(4)
  [4]=>
  int(5)
  [5]=>
  int(6)
}
string(9) "�*�aarray"
bool(false)
NULL


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



#47504 [Com]: error "SQLSTATE[HY000]: General error: 2014" with sql comments

2009-02-27 Thread admin at ifyouwantblood dot de
 ID:   47504
 Comment by:   admin at ifyouwantblood dot de
 Reported By:  admin at ifyouwantblood dot de
 Status:   Open
 Bug Type: PDO related
 Operating System: Windows XP SP 3
 PHP Version:  5.2.8
 New Comment:

also appears in 5.2.9


Previous Comments:


[2009-02-25 21:07:16] admin at ifyouwantblood dot de

Description:

i get this error with following code:

-
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other
unbuffered queries are active. Consider using PDOStatement::fetchAll().
Alternatively, if your code is only ever going to run against mysql, you
may enable query buffering by setting the
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. HY000

#0 D:\_projects\web\1.php(13): PDO->query('INSERT INTO `te...')
#1 {main} 
--

removing !SQL COMMENTS! will solve this. this only appears on windows
(XP), linux is fine. mysql version is 5.0.51a. latest XAMPP package was
used to test this (without modifications).

Reproduce code:
---
setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
$pdo->query(' CREATE TABLE IF NOT EXISTS `test` (
`some` VARCHAR( 100 ) NOT NULL
) ENGINE = INNODB ');
$pdo->query('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE');
$pdo->query('START TRANSACTION');
$pdo->query("INSERT INTO `test` (some) VALUES (''),
('1'); -- I AM AN SQL COMMENT, REMOVING ME WILL SOLVE THIS
PROBLEM");
$pdo->query("INSERT INTO `test` (some) VALUES (''),
('1')");
$pdo->query('COMMIT');



function ehandler($exception)
{
echo ''."\r\n";
echo $exception->getMessage().' '.$exception->getCode();
echo "\r\n\r\n";
echo $exception->getTraceAsString();
echo '';
} 

Expected result:

nothing

Actual result:
--
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other
unbuffered queries are active. Consider using PDOStatement::fetchAll().
Alternatively, if your code is only ever going to run against mysql, you
may enable query buffering by setting the
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. HY000

#0 D:\_projects\web\1.php(13): PDO->query('INSERT INTO `te...')
#1 {main} 





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



#47504 [NEW]: error "SQLSTATE[HY000]: General error: 2014" with sql comments

2009-02-25 Thread admin at ifyouwantblood dot de
From: admin at ifyouwantblood dot de
Operating system: Windows XP SP 3
PHP version:  5.2.8
PHP Bug Type: PDO related
Bug description:  error "SQLSTATE[HY000]: General error: 2014" with sql comments

Description:

i get this error with following code:

-
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other
unbuffered queries are active. Consider using PDOStatement::fetchAll().
Alternatively, if your code is only ever going to run against mysql, you
may enable query buffering by setting the
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. HY000

#0 D:\_projects\web\1.php(13): PDO->query('INSERT INTO `te...')
#1 {main} 
--

removing !SQL COMMENTS! will solve this. this only appears on windows
(XP), linux is fine. mysql version is 5.0.51a. latest XAMPP package was
used to test this (without modifications).

Reproduce code:
---
setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
$pdo->query(' CREATE TABLE IF NOT EXISTS `test` (
`some` VARCHAR( 100 ) NOT NULL
) ENGINE = INNODB ');
$pdo->query('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE');
$pdo->query('START TRANSACTION');
$pdo->query("INSERT INTO `test` (some) VALUES (''),
('1'); -- I AM AN SQL COMMENT, REMOVING ME WILL SOLVE THIS
PROBLEM");
$pdo->query("INSERT INTO `test` (some) VALUES (''),
('1')");
$pdo->query('COMMIT');



function ehandler($exception)
{
echo ''."\r\n";
echo $exception->getMessage().' '.$exception->getCode();
echo "\r\n\r\n";
echo $exception->getTraceAsString();
echo '';
} 

Expected result:

nothing

Actual result:
--
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other
unbuffered queries are active. Consider using PDOStatement::fetchAll().
Alternatively, if your code is only ever going to run against mysql, you
may enable query buffering by setting the
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. HY000

#0 D:\_projects\web\1.php(13): PDO->query('INSERT INTO `te...')
#1 {main} 

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



#44925 [Asn]: preg_grep and array index - follow up on #44191

2008-05-06 Thread admin at ifyouwantblood dot de
 ID:  44925
 User updated by: admin at ifyouwantblood dot de
 Reported By: admin at ifyouwantblood dot de
 Status:  Assigned
 Bug Type:PCRE related
 PHP Version: 5.2.6
 Assigned To: nlopess
 New Comment:

> PHP obviously should convert the values to string to be used in
> regex matching. Hence, i think that it should returns the string
> that was matched.

sure, internally it'll has to be converted, but i see no reason for a
change of the input array. thus preg_grep should work with a copy of the
input array...


Previous Comments:


[2008-05-06 13:07:09] [EMAIL PROTECTED]

Well, preg_grep() != in_array()...
PHP obviously should convert the values to string to be used in regex
matching. Hence, i think that it should returns the string that was
matched.

Anyway, i'll assign to the maintainer to solve this issue.

Thanks.



[2008-05-06 12:48:29] admin at ifyouwantblood dot de

>> this is a follow up on bug #44191. that was fixed, but everything
>> inside the array is now converted to a string. as i understand it,
>> the search array shouldn't change at all, so i think this is a
>> bug. please note that with objects without a __toString() method, >>
this of course leads to a fatal error.
>
> This is expected, the function is for matching strings.

sorry, but did you even take a look at the samples? preg_grep is a
SEARCH function, why should it change the INPUT array?



[2008-05-06 10:57:14] [EMAIL PROTECTED]

> this is a follow up on bug #44191. that was fixed, but everything >
inside
> the array is now converted to a string. as i understand it, the
search
> array shouldn't change at all, so i think this is a bug. please note
> that with objects without a __toString() method, this of course leads
to
> a fatal error.

This is expected, the function is for matching strings.

> another thing is, preg_grep issues a warning if you give it an
object
> instead of converting the object to an array (like other function
like
> array_flip() do)

Exactly, preg_grep() is intended for works only with arrays.

> addtionally a question: how should preg_grep react on multi-
> dimensional
> arrays anyways? convert them to a string and try to match the
pattern?
> go through every level and return a multi-dimensional array? issue a
> warning?

The PHP converts for the literal string 'Array'.
That can be viewed with: var_dump(preg_grep('//', array(array(;



Thanks.



[2008-05-06 09:49:09] admin at ifyouwantblood dot de

Description:

this is a follow up on bug #44191. that was fixed, but everything
inside the array is now converted to a string. as i understand it, the
search array shouldn't change at all, so i think this is a bug. please
note that with objects without a __toString() method, this of course
leads to a fatal error.

another thing is, preg_grep issues a warning if you give it an object
instead of converting the object to an array (like other function like
array_flip() do)

addtionally a question: how should preg_grep react on multi-dimensional
arrays anyways? convert them to a string and try to match the pattern?
go through every level and return a multi-dimensional array? issue a
warning?

Reproduce code:
---
$array=Array("1",2,3,1.1,FALSE,NULL,Array());

var_dump($array); echo "\n";

var_dump(preg_grep('/asdf/',$array)); echo "\n";

var_dump($array); echo "\n";

var_dump(preg_grep('/asdf/',new stdClass)); echo "\n";

Expected result:

array(8) { [0]=> string(1) "1" [1]=> int(2) [2]=> int(3) [3]=>
float(1.1) [4]=> bool(false) [5]=> NULL [6]=> array(0) { } [7]=>
object(stdClass)#8 (0) { } } 

array(0) { }

array(8) { [0]=> string(1) "1" [1]=> int(2) [2]=> int(3) [3]=>
float(1.1) [4]=> bool(false) [5]=> NULL [6]=> array(0) { } }  

array(0) { }

Actual result:
--
array(7) { [0]=> string(1) "1" [1]=> int(2) [2]=> int(3) [3]=>
float(1.1) [4]=> bool(false) [5]=> NULL [6]=> array(0) { } } 

Notice: Array to string conversion in D:\_projects\preg_grep.php

array(0) { } 

array(7) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3"
[3]=> string(3) "1.1" [4]=> string(0) "" [5]=> string(0) "" [6]=>
string(5) "Array" }

Warning: preg_grep() expects parameter 2 to be array, object given in
D:\_projects\cms\admin\data\classes\class.article.php on line 13
NULL 







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



#44925 [Bgs]: preg_grep and array index - follow up on #44191

2008-05-06 Thread admin at ifyouwantblood dot de
 ID:  44925
 User updated by: admin at ifyouwantblood dot de
 Reported By: admin at ifyouwantblood dot de
 Status:  Bogus
 Bug Type:PCRE related
 PHP Version: 5.2.6
 New Comment:

>> this is a follow up on bug #44191. that was fixed, but everything
>> inside the array is now converted to a string. as i understand it,
>> the search array shouldn't change at all, so i think this is a
>> bug. please note that with objects without a __toString() method, >>
this of course leads to a fatal error.
>
> This is expected, the function is for matching strings.

sorry, but did you even take a look at the samples? preg_grep is a
SEARCH function, why should it change the INPUT array?


Previous Comments:


[2008-05-06 10:57:14] [EMAIL PROTECTED]

> this is a follow up on bug #44191. that was fixed, but everything >
inside
> the array is now converted to a string. as i understand it, the
search
> array shouldn't change at all, so i think this is a bug. please note
> that with objects without a __toString() method, this of course leads
to
> a fatal error.

This is expected, the function is for matching strings.

> another thing is, preg_grep issues a warning if you give it an
object
> instead of converting the object to an array (like other function
like
> array_flip() do)

Exactly, preg_grep() is intended for works only with arrays.

> addtionally a question: how should preg_grep react on multi-
> dimensional
> arrays anyways? convert them to a string and try to match the
pattern?
> go through every level and return a multi-dimensional array? issue a
> warning?

The PHP converts for the literal string 'Array'.
That can be viewed with: var_dump(preg_grep('//', array(array(;



Thanks.

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

[2008-05-06 09:49:09] admin at ifyouwantblood dot de

Description:

this is a follow up on bug #44191. that was fixed, but everything
inside the array is now converted to a string. as i understand it, the
search array shouldn't change at all, so i think this is a bug. please
note that with objects without a __toString() method, this of course
leads to a fatal error.

another thing is, preg_grep issues a warning if you give it an object
instead of converting the object to an array (like other function like
array_flip() do)

addtionally a question: how should preg_grep react on multi-dimensional
arrays anyways? convert them to a string and try to match the pattern?
go through every level and return a multi-dimensional array? issue a
warning?

Reproduce code:
---
$array=Array("1",2,3,1.1,FALSE,NULL,Array());

var_dump($array); echo "\n";

var_dump(preg_grep('/asdf/',$array)); echo "\n";

var_dump($array); echo "\n";

var_dump(preg_grep('/asdf/',new stdClass)); echo "\n";

Expected result:

array(8) { [0]=> string(1) "1" [1]=> int(2) [2]=> int(3) [3]=>
float(1.1) [4]=> bool(false) [5]=> NULL [6]=> array(0) { } [7]=>
object(stdClass)#8 (0) { } } 

array(0) { }

array(8) { [0]=> string(1) "1" [1]=> int(2) [2]=> int(3) [3]=>
float(1.1) [4]=> bool(false) [5]=> NULL [6]=> array(0) { } }  

array(0) { }

Actual result:
--
array(7) { [0]=> string(1) "1" [1]=> int(2) [2]=> int(3) [3]=>
float(1.1) [4]=> bool(false) [5]=> NULL [6]=> array(0) { } } 

Notice: Array to string conversion in D:\_projects\preg_grep.php

array(0) { } 

array(7) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3"
[3]=> string(3) "1.1" [4]=> string(0) "" [5]=> string(0) "" [6]=>
string(5) "Array" }

Warning: preg_grep() expects parameter 2 to be array, object given in
D:\_projects\cms\admin\data\classes\class.article.php on line 13
NULL 







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



#44925 [NEW]: preg_grep and array index - follow up on #44191

2008-05-06 Thread admin at ifyouwantblood dot de
From: admin at ifyouwantblood dot de
Operating system: 
PHP version:  5.2.6
PHP Bug Type: PCRE related
Bug description:  preg_grep and array index - follow up on #44191

Description:

this is a follow up on bug #44191. that was fixed, but everything inside
the array is now converted to a string. as i understand it, the search
array shouldn't change at all, so i think this is a bug. please note that
with objects without a __toString() method, this of course leads to a fatal
error.

another thing is, preg_grep issues a warning if you give it an object
instead of converting the object to an array (like other function like
array_flip() do)

addtionally a question: how should preg_grep react on multi-dimensional
arrays anyways? convert them to a string and try to match the pattern? go
through every level and return a multi-dimensional array? issue a warning?

Reproduce code:
---
$array=Array("1",2,3,1.1,FALSE,NULL,Array());

var_dump($array); echo "\n";

var_dump(preg_grep('/asdf/',$array)); echo "\n";

var_dump($array); echo "\n";

var_dump(preg_grep('/asdf/',new stdClass)); echo "\n";

Expected result:

array(8) { [0]=> string(1) "1" [1]=> int(2) [2]=> int(3) [3]=> float(1.1)
[4]=> bool(false) [5]=> NULL [6]=> array(0) { } [7]=> object(stdClass)#8
(0) { } } 

array(0) { }

array(8) { [0]=> string(1) "1" [1]=> int(2) [2]=> int(3) [3]=> float(1.1)
[4]=> bool(false) [5]=> NULL [6]=> array(0) { } }  

array(0) { }

Actual result:
--
array(7) { [0]=> string(1) "1" [1]=> int(2) [2]=> int(3) [3]=> float(1.1)
[4]=> bool(false) [5]=> NULL [6]=> array(0) { } } 

Notice: Array to string conversion in D:\_projects\preg_grep.php

array(0) { } 

array(7) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3"
[3]=> string(3) "1.1" [4]=> string(0) "" [5]=> string(0) "" [6]=> string(5)
"Array" }

Warning: preg_grep() expects parameter 2 to be array, object given in
D:\_projects\cms\admin\data\classes\class.article.php on line 13
NULL 



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



#44235 [Opn]: implementing interface traversable causes apache error message

2008-02-24 Thread admin at ifyouwantblood dot de
 ID:   44235
 User updated by:  admin at ifyouwantblood dot de
 Reported By:  admin at ifyouwantblood dot de
 Status:   Open
 Bug Type: Class/Object related
 Operating System: Windows XP
 PHP Version:  5.2.5
 New Comment:

screenshot: http://www.ifyouwantblood.de/rest/traversable.jpg


Previous Comments:


[2008-02-24 15:38:00] admin at ifyouwantblood dot de

Description:

implementing (internal) interface Traversable generates, under Windows
XP Apache 2.2, an Apache errormessage in a separate window.

Reproduce code:
---
class test implements Traversable {}






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


#44235 [NEW]: implementing interface traversable causes apache error message

2008-02-24 Thread admin at ifyouwantblood dot de
From: admin at ifyouwantblood dot de
Operating system: Windows XP
PHP version:  5.2.5
PHP Bug Type: Class/Object related
Bug description:  implementing interface traversable causes apache error message

Description:

implementing (internal) interface Traversable generates, under Windows XP
Apache 2.2, an Apache errormessage in a separate window.

Reproduce code:
---
class test implements Traversable {}


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


#44191 [NEW]: preg_grep messes up array index

2008-02-20 Thread admin at ifyouwantblood dot de
From: admin at ifyouwantblood dot de
Operating system: Windows XP
PHP version:  5.2.5
PHP Bug Type: PCRE related
Bug description:  preg_grep messes up array index

Description:

preg_grep messes up the given array.

Reproduce code:
---
\n";

debug_zval_dump(preg_grep('/asdf/',$array)); echo "\n";

while(list($key,$value)=each($array)) echo "Array: ".$value." ";

echo "\n";

debug_zval_dump($array); echo "\n";

?>

Expected result:

array(3) refcount(2){ [0]=> long(1) refcount(1) [1]=> long(2) refcount(1)
[2]=> long(3) refcount(1) } 
array(0) refcount(1){ } 
Array: 1 Array: 2 Array: 3 
array(3) refcount(2){ [0]=> long(1) refcount(1) [1]=> long(2) refcount(1)
[2]=> long(3) refcount(1) } 

Actual result:
--
PHP6 Build Jan 20 2008 18:04:22
array(3) refcount(2){ [0]=> long(1) refcount(1) [1]=> long(2) refcount(1)
[2]=> long(3) refcount(1) } 
array(0) refcount(1){ } 

array(3) refcount(2){ [0]=> long(1) refcount(1) [1]=> long(2) refcount(1)
[2]=> long(3) refcount(1) } 

-PHP5.2.5
array(3) refcount(2){ [0]=> long(1) refcount(1) [1]=> long(2) refcount(1)
[2]=> long(3) refcount(1) } 
array(0) refcount(1){ } 

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

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


#44017 [NEW]: wrong error discription with include/require in static method

2008-02-01 Thread admin at ifyouwantblood dot de
From: admin at ifyouwantblood dot de
Operating system: 
PHP version:  5.2.5
PHP Bug Type: Class/Object related
Bug description:  wrong error discription with include/require in static method

Description:

include/require (_once) return wrong error messages when used inside a
static method. the function name as well as the manual link are prefixed by
the classname.

Reproduce code:
---


Actual result:
--
Warning: test::require_once(i_do_not_exists.php)
[function.test-require-once]: failed to open stream: No such file or
directory

Fatal error: test::require_once() [function.require]: Failed opening
required 'i_do_not_exists.php' (include_path='.;C:\php5\pear')

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


#37796 [Com]: t_is_not_identical for <> ?

2008-01-26 Thread admin at ifyouwantblood dot de
 ID:   37796
 Comment by:   admin at ifyouwantblood dot de
 Reported By:  nics at mail dot com
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: *
 PHP Version:  6CVS-2006-06-13 (snap)
 New Comment:

<=> would look nicer ;-) still i think <> can be removed, its just
an overhead with no real use.


Previous Comments:


[2006-06-13 20:39:47] nics at mail dot com

Description:

Just my ideas for the equivalent of <>.

I noticed that it did not have for operator <> with the type
comparison.

File: ZendEngine2/zend_language_scanner.l

- "!==" {
+ "!=="|"<>=" {
return T_IS_NOT_IDENTICAL;
 }

Actual result:
--
!= and <>
!== don't have equivalent with "<>"





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


#43809 [NEW]: strtok() should return FALSE if needle wasnt found

2008-01-10 Thread admin at ifyouwantblood dot de
From: admin at ifyouwantblood dot de
Operating system: Any
PHP version:  5.2.5
PHP Bug Type: Feature/Change Request
Bug description:  strtok() should return FALSE if needle wasnt found

Description:

In PHP 4.1 strtok() has been changed to return FALSE if a repeated token
wasnt found in the haystack string. It should also return FALSE if needle
wasnt found at first place.

Reproduce code:
---


Expected result:

bool(false)

Actual result:
--
string(9) "something"

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


#42626 [Opn->Csd]: file operations in destructor cause weird results

2007-10-25 Thread admin at ifyouwantblood dot de
 ID:   42626
 User updated by:  admin at ifyouwantblood dot de
 Reported By:  admin at ifyouwantblood dot de
-Status:   Open
+Status:   Closed
 Bug Type: Class/Object related
 Operating System: Windows XP SP2
 PHP Version:  5.2.4
 New Comment:

allright guys it should be mentioned somewhere that the destructor's
base directory is the root of the server. so this 'bug' is not a bug,
but a simple mistake which could have been avoided just by telling
this

the given sample searches for the file in the base directory of the
server. unfortunatly i had had a file there with the name 'datei.txt'
which then was read by/written to by php.

but to my reassurance none of the developers seems to know this, or
else they would have said something, wouldn't they?

so, if any one ever reads this, where can i communicate with the PHP
Manual team in order to tell this (and something else)?

greetings.


Previous Comments:
----

[2007-10-22 21:58:38] admin at ifyouwantblood dot de

hi,

now i get the following with windows 5.2.5RC2 build Oct 22 2007
12:03:56 althought the file exists (but with size 0):

--
filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0

Warning:  filesize() [function.filesize]: stat failed for datei.txt in
F:\php\htdocs\ALL\bug.php on line 30
filesize after clearstatcache: 

Warning:  fopen(datei.txt) [function.fopen]: failed to open stream: No
such file or directory in F:\php\htdocs\ALL\bug.php on line 32
---



[2007-10-22 11:23:01] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi





[2007-09-12 00:14:41] admin at tifyouwantblood dot de

this works as expected on PHP 5.2.2 on SunOS.

----

[2007-09-11 19:18:08] admin at ifyouwantblood dot de

Description:

Calling clearstatcache() in destructor causes some very weird stuff.
In the code below a file is created / truncated in the constructor. If
you want to read the same file with fread in the destructor while it's
still empty i'm expecting fread to print an error which it does. However
if you write something to the file AFTER reading it and run the script
twice fread returns what's written before. This should not happen,
because before reading the file, we truncate it. Moreover if you
continue calling the script, the string that fread returns contains all
the writing operations done before.

The strangest thing is, that it looks like that this behavior got
something to do with the filename "datei.txt" (is German, means
file.txt). If you change the filename, the fopen($this->filename,'r+')
after clearstatcache() fails with the error "file does not exists".

If you explicite truncate the file before reading it with ftruncate()
no error is printed.

If you remove clearstatcache() in the destructor it works as expected.

This also appears on PHP 5.2.3


Reproduce code:
---

filename,'w');
fclose($file);

echo 'filesize after truncate: '.filesize($this->filename)."\n";
}

public function __destruct()
{
echo 'Destructing test'."\n";
echo 'filesize before clearstatcache:
'.filesize($this->filename)."\n";

clearstatcache();

echo 'filesize after clearstatcache:
'.filesize($this->filename)."\n";

$file=fopen($this->filename,'r+');
if($file)
{
echo 'Reading file: 
'.fread($file,filesize($this->filename));
fputs($file,'aasadf');
}
}
}

?>

Expected result:

filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0
filesize after clearstatcache: 0

Warning: fread() [function.fread]: Length parameter must be greater
than 0 in G:\php\htdocs\cms\1jailbreak\admin\constructor.php on line 34

Reading file: 

Actual result:
--
filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0
filesize after clearstatcache: 6
Reading file: aasadf

-

on repeated calling:

filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0
filesize

#42626 [Fbk->Opn]: file operations in destructor cause weird results

2007-10-22 Thread admin at ifyouwantblood dot de
 ID:   42626
 User updated by:  admin at ifyouwantblood dot de
 Reported By:  admin at ifyouwantblood dot de
-Status:   Feedback
+Status:   Open
 Bug Type: Class/Object related
 Operating System: Windows XP SP2
 PHP Version:  5.2.4
 New Comment:

hi,

now i get the following with windows 5.2.5RC2 build Oct 22 2007
12:03:56 althought the file exists (but with size 0):

--
filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0

Warning:  filesize() [function.filesize]: stat failed for datei.txt in
F:\php\htdocs\ALL\bug.php on line 30
filesize after clearstatcache: 

Warning:  fopen(datei.txt) [function.fopen]: failed to open stream: No
such file or directory in F:\php\htdocs\ALL\bug.php on line 32
---


Previous Comments:


[2007-10-22 11:23:01] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi





[2007-09-12 00:14:41] admin at tifyouwantblood dot de

this works as expected on PHP 5.2.2 on SunOS.



[2007-09-11 19:18:08] admin at ifyouwantblood dot de

Description:

Calling clearstatcache() in destructor causes some very weird stuff.
In the code below a file is created / truncated in the constructor. If
you want to read the same file with fread in the destructor while it's
still empty i'm expecting fread to print an error which it does. However
if you write something to the file AFTER reading it and run the script
twice fread returns what's written before. This should not happen,
because before reading the file, we truncate it. Moreover if you
continue calling the script, the string that fread returns contains all
the writing operations done before.

The strangest thing is, that it looks like that this behavior got
something to do with the filename "datei.txt" (is German, means
file.txt). If you change the filename, the fopen($this->filename,'r+')
after clearstatcache() fails with the error "file does not exists".

If you explicite truncate the file before reading it with ftruncate()
no error is printed.

If you remove clearstatcache() in the destructor it works as expected.

This also appears on PHP 5.2.3


Reproduce code:
---

filename,'w');
fclose($file);

echo 'filesize after truncate: '.filesize($this->filename)."\n";
}

public function __destruct()
{
echo 'Destructing test'."\n";
echo 'filesize before clearstatcache:
'.filesize($this->filename)."\n";

clearstatcache();

echo 'filesize after clearstatcache:
'.filesize($this->filename)."\n";

$file=fopen($this->filename,'r+');
if($file)
{
echo 'Reading file: 
'.fread($file,filesize($this->filename));
fputs($file,'aasadf');
}
}
}

?>

Expected result:

filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0
filesize after clearstatcache: 0

Warning: fread() [function.fread]: Length parameter must be greater
than 0 in G:\php\htdocs\cms\1jailbreak\admin\constructor.php on line 34

Reading file: 

Actual result:
--
filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0
filesize after clearstatcache: 6
Reading file: aasadf

-

on repeated calling:

filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0
filesize after clearstatcache: 12
Reading file: aasadfaasadf

-

filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0
filesize after clearstatcache: 18
Reading file: aasadfaasadfaasadf

and so on...





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


#42628 [Com]: WRONG ARITMETHIC RESULT

2007-09-11 Thread admin at ifyouwantblood dot de
 ID:   42628
 Comment by:   admin at ifyouwantblood dot de
 Reported By:  jortac2002 at yahoo dot com dot mx
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: WINDOWS XP PROFESSIONAL
 PHP Version:  5.2.4
 New Comment:

This is the thing with floating numbers, just as the manual states:

   It is quite usual that simple decimal fractions like 0.1 or 0.7
cannot be converted into their internal binary counterparts without a
little loss of precision.

The follwing works as you would expect it therefore:

";
   if ($four == $one) {
  echo "THEY ARE EQUAL ";
   }
   else {
  echo "THEY ARE NOT  EQUAL DIFFERENCE " . $difer . "";
   }
?>


Previous Comments:


[2007-09-11 19:44:27] jortac2002 at yahoo dot com dot mx

Description:

I have the following code :
It is very simple code, and the result is very stange because
amounts are the same but result shows "NOT EQUAL"

Reproduce code:
---


";
   if ($four == $one) {
  echo "THEY ARE EQUAL ";
   }
   else {
  echo "THEY ARE NOT  EQUAL DIFFERENCE " . $difer . "";
   }
?>



Expected result:

THEY ARE EQUAL

Actual result:
--
THEY ARE NOT EQUAL DIFFERENCE -2.737367544323E-013





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


#42626 [NEW]: file operations in destructor cause weird results

2007-09-11 Thread admin at ifyouwantblood dot de
From: admin at ifyouwantblood dot de
Operating system: Windows XP SP2
PHP version:  5.2.4
PHP Bug Type: Class/Object related
Bug description:  file operations in destructor cause weird results

Description:

Calling clearstatcache() in destructor causes some very weird stuff.
In the code below a file is created / truncated in the constructor. If you
want to read the same file with fread in the destructor while it's still
empty i'm expecting fread to print an error which it does. However if you
write something to the file AFTER reading it and run the script twice fread
returns what's written before. This should not happen, because before
reading the file, we truncate it. Moreover if you continue calling the
script, the string that fread returns contains all the writing operations
done before.

The strangest thing is, that it looks like that this behavior got
something to do with the filename "datei.txt" (is German, means file.txt).
If you change the filename, the fopen($this->filename,'r+') after
clearstatcache() fails with the error "file does not exists".

If you explicite truncate the file before reading it with ftruncate() no
error is printed.

If you remove clearstatcache() in the destructor it works as expected.

This also appears on PHP 5.2.3


Reproduce code:
---

filename,'w');
fclose($file);

echo 'filesize after truncate: '.filesize($this->filename)."\n";
}

public function __destruct()
{
echo 'Destructing test'."\n";
echo 'filesize before clearstatcache: 
'.filesize($this->filename)."\n";

clearstatcache();

echo 'filesize after clearstatcache: 
'.filesize($this->filename)."\n";

$file=fopen($this->filename,'r+');
if($file)
{
echo 'Reading file: 
'.fread($file,filesize($this->filename));
fputs($file,'aasadf');
}
}
}

?>

Expected result:

filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0
filesize after clearstatcache: 0

Warning: fread() [function.fread]: Length parameter must be greater than 0
in G:\php\htdocs\cms\1jailbreak\admin\constructor.php on line 34

Reading file: 

Actual result:
--
filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0
filesize after clearstatcache: 6
Reading file: aasadf

-

on repeated calling:

filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0
filesize after clearstatcache: 12
Reading file: aasadfaasadf

-

filesize after truncate: 0
Destructing test
filesize before clearstatcache: 0
filesize after clearstatcache: 18
Reading file: aasadfaasadfaasadf

and so on...

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


#37099 [NEW]: str_replace with arrays - weird behaviour

2006-04-16 Thread admin at ifyouwantblood dot de
From: admin at ifyouwantblood dot de
Operating system: Linux AND windows
PHP version:  5.1.2
PHP Bug Type: Strings related
Bug description:  str_replace with arrays - weird behaviour

Description:

str_replace does not replace all array values with the associated array
replace.

Reproduce code:
---


Expected result:

gvhg
test

Actual result:
--
gehg 
tvst

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