Skip to content

Amixa Technical Blog

Category: PHP

PHP Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Easy fix for the PHP error “PHP Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated” This was the existing code that was in a WordPress plugin: $D8 = preg_replace(“\57\x5c\163\x2b\x2f\123”, “\40”, $D8); This is the fixed code, which no longer throws the depreciated error: $D8 = preg_replace(“\57\x5c\163\x2b\x2f\123”, “\40”, (string) $D8); If…

Read article