php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26639 mb_convert_variables() clutters variables beyond the references
Submitted: 2003-12-16 06:42 UTC Modified: 2003-12-18 04:52 UTC
Votes:19
Avg. Score:3.8 ± 1.0
Reproduced:6 of 7 (85.7%)
Same Version:4 (66.7%)
Same OS:2 (33.3%)
From: s dot masugata at digicom dot dnp dot co dot jp Assigned:
Status: Closed Package: mbstring related
PHP Version: 4.3.4 OS: Linux/Solaris(sparc)
Private report: No CVE-ID: None
 [2003-12-16 06:42 UTC] s dot masugata at digicom dot dnp dot co dot jp
Description:
------------
Array which mb_convert_variables does not specify is 
changed.

I think that this operation is not specification but 
a bug with it being individual.

Isn't it changed about this operation by PHP4.3.5 or 
it or later?


Reproduce code:
---------------
<?
// no problem.
$Str1  = "multi-byte string's";
$Str2 = $Str1;

mb_convert_variables( "SJIS",
                      mb_detect_order( ),
                      $Str2 );
var_dump( $Str1 );
var_dump( $Str2 );

// unexpected operation.
$Array1  = array( "multi-byte string's" );
$Array2  = $Array1;

mb_convert_variables( "SJIS",
                      mb_detect_order( ),
                      $Array2 );
var_dump( $Array1 );
var_dump( $Array2 );
?>


Expected result:
----------------
string(4) "no changed multi-byte string's"
string(3) "changed multi-byte string's"
array(1) {
  [0]=>
  string(3) "no changed multi-byte string's"
}
array(1) {
  [0]=>
  string(3) "changed multi-byte string's"
}


Actual result:
--------------
string(4) "no changed multi-byte string's"
string(3) "changed multi-byte string's"
array(1) {
  [0]=>
  string(4) "no changed multi-byte string's"
}
array(1) {
  [0]=>
  string(3) "changed multi-byte string's"
}

string(4) "no changed multi-byte string's"
string(3) "changed multi-byte string's"
array(1) {
  [0]=>
  string(3) "changed multi-byte string's"
}
array(1) {
  [0]=>
  string(3) "changed multi-byte string's"
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-16 06:45 UTC] s dot masugata at digicom dot dnp dot co dot jp
sorry, Actual result was wrong.

Actual result:
--------------
string(4) "no changed multi-byte string's"
string(3) "changed multi-byte string's"
array(1) {
  [0]=>
  string(3) "changed multi-byte string's"
}
array(1) {
  [0]=>
  string(3) "changed multi-byte string's"
}
 [2003-12-18 04:49 UTC] moriyoshi@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, 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/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC