Re: Re: strtr array replace issue...

From: Date: Tue, 10 Feb 2009 01:54:25 +0000
Subject: Re: Re: strtr array replace issue...
References: 1 2  Groups: php.install 
Request: Send a blank email to php-install+get-19593@lists.php.net to get a copy of this message
Brad Freshour wrote:
Keith, thanks... no luck doing it that way either... Can someone else try the snippet and see what is returned? php > $a = "/home/user/public_html/Packages/temp"; php > $b = array('' => ''); php > echo strtr($a, $b); php > echo $a; /home/user/public_html/Packages/temp php > print_r($b); Array (
    [] =>
)
PHP 4.3.9, 5.2 and 5.3 all do the same. Note the return value from phptr() is false (try var_dump instead of print_r) You can debug what PHP is doing by breaking on php_strtr_array() in ext/standard/standard.c. If a zero length key is seen, it returns false. As to expected behavior: feel free to log a bug, but be prepared to defend your reasoning. Chris -- Email: christopher.jones@oracle.com Tel: +1 650 506 8630 Twitter: http://twitter.com/ghrd Free PHP Book: http://tinyurl.com/UGPOM

« previous php.install (#19593) next »