|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14217 Strange bug with strtr() function
Submitted: 2001-11-25 10:26 UTC Modified: 2002-05-24 20:30 UTC
From: akul at otamedia dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.0.6 OS: windows 98
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: akul at otamedia dot com
New email:
PHP Version: OS:


 [2001-11-25 10:26 UTC] akul at otamedia dot com
I have very simple function to convert some sumbols to underscores:

function to_tag($text)
	$from=" \"\t\\/:#$%^&*()=+-!`'~?<>[],.";
              // debug output
	echo "\r\n<BR>[$text] >> [$retval]";
	return $retval;

And I have such string (first world is russian, Win-1251): "?????????  d'fusion"

On simple example all is Ok:
	to_tag("?????????  d'fusion");

X-Powered-By: PHP/4.0.7-dev
Content-type: text/html; charset=windows-1251

<BR>[?????????  d'fusion] >> [?????????__d_fusion]

If this function called from more complex real code, ['] doesn't converted:

 Function using to_tag():

	function getPropXML($FID,$TID)
		return t(to_tag($target->Name)

Debug output for object with this string:
<BR>[????????] >> [????????]
<BR>[????????? d'fusion] >> [?????????_d'fusion]
<BR>[$25-70] >> [_25_70]

I tried to clear situation and find point of bug, but can't :(


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-24 20:30 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from

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.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 23:01:29 2024 UTC