From:             [EMAIL PROTECTED]
Operating system: Linux (at least)
PHP version:      4.2.3
PHP Bug Type:     Strings related
Bug description:  str_rot13() changes too much

a) str_rot13() changes it's given variable.
b) str_rot13() changes OTHER variables.

8<----------------------------
$ cat test.php
<?php
 $first = "boo";
 $second = $first;
 $rot = "";

 echo "1: ".$first."\n";
 echo "2: ".$second."\n";
 echo "3: ".$rot."\n";

 $rot = str_rot13($second);

 echo "1: ".$first."\n";
 echo "2: ".$second."\n";
 echo "3: ".$rot."\n";
?>
--------------------------->8

8<-----------------------
$ php4 -q test.php
1: boo
2: boo
3:
1: obb
2: obb
3: obb
----------------------->8

The changing of 1 is quite odd (subbug B) and very annoying.
The changing of 2 is probably because it happens in place.

Either way $first shouldn't be touched at all.

This is on Debian Linux/unstable, but others are probably affected too.

-- 
Edit bug report at http://bugs.php.net/?id=20261&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=20261&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=20261&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=20261&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=20261&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=20261&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=20261&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=20261&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=20261&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=20261&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=20261&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20261&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=20261&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=20261&r=isapi

Reply via email to