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

From: Date: Wed, 20 Sep 2017 10:46:00 +0000
Subject: Bug #66057 [Com]: strtr converts unused variables to strings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211260@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 Comment by: tim_siebels_aurich at yahoo dot de Reported by: themylogin at gmail dot com Summary: strtr converts unused variables to strings Status: Assigned Type: Bug Package: Strings related Operating System: Linux PHP Version: 5.5.5 Assigned To: cataphract Block user comment: N Private report: N New Comment: This seems to be fixed in PHP7.0 onwards. http://3v4l.org/0fFcj Previous Comments: ------------------------------------------------------------------------ [2013-11-13 08:42:33] laruence@php.net @cataphract could you please look into this? thanks ------------------------------------------------------------------------ [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 (#211260) next »