Bug #66057 [Opn]: strtr converts unused variables to strings

From: Date: Wed, 13 Nov 2013 08:42:33 +0000
Subject: Bug #66057 [Opn]: strtr converts unused variables to strings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182727@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66057&edit=1 ID: 66057 Updated by: laruence@php.net Reported by: themylogin at gmail dot com Summary: strtr converts unused variables to strings Status: Open Type: Bug Package: Strings related Operating System: Linux PHP Version: 5.5.5 -Assigned To: +Assigned To: cataphract Block user comment: N Private report: N New Comment: @cataphract could you please look into this? thanks Previous Comments: ------------------------------------------------------------------------ [2013-11-13 08:36:29] laruence@php.net confirm this bc break, it starts from 5.4.12 http://3v4l.org/0fFcj and it was introduced in https://github.com/php/php-src/commit/2111ee3d ------------------------------------------------------------------------ [2013-11-08 07:46:59] themylogin at gmail dot com fix typo ------------------------------------------------------------------------ [2013-11-08 07:45:59] themylogin at gmail dot com Description: ------------ With PHP 5.5.5 when I call php > strtr("a", array("a" => "b", "c" => new stdclass)); I get PHP Catchable fatal error: Object of class stdClass could not be converted to string in php shell code on line 1 This used to work with PHP 5.4 and there is no reason why it shouldn't work now (haystack does not contain "c", so variable with appropriate key should not be used anyway). Test script: --------------- strtr("a", array("a" => "b", "c" => new stdclass)); Expected result: ---------------- No error Actual result: -------------- PHP Catchable fatal error: Object of class stdClass could not be converted to string in php shell code on line 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66057&edit=1

« previous php.bugs (#182727) next »