Title: PHP deprecated: passing null to str_replace
Last modified: November 18, 2024

---

# PHP deprecated: passing null to str_replace

 *  Resolved [henning22](https://wordpress.org/support/users/henning22/)
 * (@henning22)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/php-deprecated-passing-null-to-str_replace/)
 * Hi there,
   there is a PHP deprecated message that is spamming my logfile since
   a long time. Could you please have a look on how to fix this. The message is:
 * _PHP Deprecated:  str\_replace(): Passing null to parameter #3 ($subject) of 
   type array|string is deprecated in [ROOT\_PATH\_HERE]/wp-content/plugins/fast-
   velocity-minify/inc/frontend.php on line 1075_
 * In the mentioned line I found this code:
 * _add fvm\_footer scripts, if enabled
   if(fvm\_can\_minify\_js()) { $fm = fvm\_add\
   _footer\_function($fm);}$hm = str\_replace(array(”, ”), ”, $hm);$hm\_late = str\
   _replace(array(”, ”), ”, $hm\_late);$fm = str\_replace(”, ”, $fm); // **this 
   is line 1075**
 * The function _fvm\_add\_footer\_function_ (defined in line 2193 in \wp-content\
   plugins\fast-velocity-minify\inc\common.php) returns nothing (void), so I am 
   pretty sure this is the cause of the deprecated message.
 * Best regards,
   Henning

Viewing 1 replies (of 1 total)

 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/php-deprecated-passing-null-to-str_replace/#post-18308128)
 * Hi, it’s been a while because I only work on this on my free time, and I haven’t
   had time for the project in a long time. 
   Normally, _PHP Deprecated_ errors, 
   only show up if you specifically enable error logging at that level, and it doesn’t
   affect the normal usage of sites in production (live sites). You should probably
   not have that level of error enabled on production sites, but it’s up to you.
   That error also appears to mean, that you don’t have the correct [wp_footer](https://developer.wordpress.org/reference/hooks/wp_footer/)
   hook on your theme, or at least on some page templates, else it shouldn’t show
   up (it’s supposed to be there). That being said, it doesn’t change the fact that
   the error should be accounted for and fixed, so I have pushed a quick release
   to sort it out.I don’t have much time for this plugin at the moment, but it is
   maintained.

Viewing 1 replies (of 1 total)

The topic ‘PHP deprecated: passing null to str_replace’ is closed to new replies.

 * ![](https://ps.w.org/fast-velocity-minify/assets/icon-128x128.jpg?rev=1440946)
 * [Fast Velocity Minify](https://wordpress.org/plugins/fast-velocity-minify/)
 * [Support Threads](https://wordpress.org/support/plugin/fast-velocity-minify/)
 * [Active Topics](https://wordpress.org/support/plugin/fast-velocity-minify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/fast-velocity-minify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/fast-velocity-minify/reviews/)

## Tags

 * [deprecated](https://wordpress.org/support/topic-tag/deprecated/)
 * [str_replace](https://wordpress.org/support/topic-tag/str_replace/)

 * 1 reply
 * 3 participants
 * Last reply from: [Raul P.](https://wordpress.org/support/users/alignak/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/php-deprecated-passing-null-to-str_replace/#post-18308128)
 * Status: resolved