note 112930 added to function.strtr

From: Date: Thu, 08 Aug 2013 08:26:54 +0000
Subject: note 112930 added to function.strtr
Groups: php.notes 
Request: Send a blank email to php-notes+get-195910@lists.php.net to get a copy of this message
strstr will issue a notice when $replace_pairs contains an array, even unused, with php 5.5.0. It was not the case with version at least up to 5.3.2, but I'm not sure the notice was added with exactly 5.5.0. <?php $str = 'hi all, I said hello'; $replace_pairs = array( 'all' => 'everybody', 'unused' => array('somtehing', 'something else'), 'hello' => 'hey', ); // php 5.5.0 Notice: Array to string conversion in test.php on line 8 echo strtr($str, $replace_pairs); // hi everybody, I said hey ?> since the result is still correct, @strstr seems a working solution. ---- Server IP: 69.147.83.199 Probable Submitter: 90.29.95.28 ---- Manual Page -- http://php.net/manual/en/function.strtr.php Edit -- https://master.php.net/note/edit/112930 Del: integrated -- https://master.php.net/note/delete/112930/integrated Del: useless -- https://master.php.net/note/delete/112930/useless Del: bad code -- https://master.php.net/note/delete/112930/bad+code Del: spam -- https://master.php.net/note/delete/112930/spam Del: non-english -- https://master.php.net/note/delete/112930/non-english Del: in docs -- https://master.php.net/note/delete/112930/in+docs Del: other reasons-- https://master.php.net/note/delete/112930 Reject -- https://master.php.net/note/reject/112930 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195910) next »