PHP 8.5.0 Beta 1 available for testing

Voting

: three plus zero?
(Example: nine)

The Note You're Voting On

dcz at phpbb-seo dot com
12 years ago
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.

<< Back to user notes page

To Top