Title: PHP 5.5 preg_replace() /e modifier depricated
Last modified: August 21, 2016

---

# PHP 5.5 preg_replace() /e modifier depricated

 *  Resolved [swinggraphics](https://wordpress.org/support/users/swinggraphics/)
 * (@swinggraphics)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-55-preg_replace-e-modifier-depricated/)
 * Here are the changes to make for 5.5 compatibility:
 * Change
 * `$string = preg_replace("/\%post_date_gmt\(([a-zA-Z\s\\\\:,]*)\)/e", "mysql2date('
   $1', '$post_date_gmt')", $string);`
 * to
 * `$string = preg_replace_callback("/\%post_date_gmt\(([a-zA-Z\s\\\\:,]*)\)/", 
   create_function('$matches', 'return mysql2date($matches[1], $post_date_gmt);'),
   $string);`
 * Change
 * `$string = preg_replace("/\%post_date\(([a-zA-Z\s\\\\:,]*)\)/e", "mysql2date('
   $1', '$post_date')", $string);`
 * to
 * `$string = preg_replace_callback("/\%post_date\(([a-zA-Z\s\\\\:,]*)\)/", create_function('
   $matches', 'return mysql2date($matches[1], $post_date);'), $string);`
 * Change
 * `$string = preg_replace("/\%post_modified_gmt\(([a-zA-Z\s\\\\:,]*)\)/e", "mysql2date('
   $1', '$post_modified_gmt')", $string);`
 * to
 * `$string = preg_replace_callback("/\%post_modified_gmt\(([a-zA-Z\s\\\\:,]*)\)/",
   create_function('$matches', 'return mysql2date($matches[1], $post_modified_gmt);'),
   $string);`
 * Change
 * `$string = preg_replace("/\%post_modified\(([a-zA-Z\s\\\\:,]*)\)/e", "mysql2date('
   $1', '$post_modified')", $string);`
 * to
 * `$string = preg_replace_callback("/\%post_modified\(([a-zA-Z\s\\\\:,]*)\)/", 
   create_function('$matches', 'return mysql2date($matches[1], $post_modified);'),
   $string);`

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-55-preg_replace-e-modifier-depricated/#post-4490584)
 * Thank you for reporting, this will be fixed in the next version. Working on it
   right now.
 * Kind regards,
    Diana
 *  Plugin Author [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-55-preg_replace-e-modifier-depricated/#post-4490585)
 * Fixed in 0.9.1

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP 5.5 preg_replace() /e modifier depricated’ is closed to new replies.

 * ![](https://ps.w.org/category-posts-in-custom-menu/assets/icon-128x128.png?rev
   =2539336)
 * [Category Posts in Custom Menu](https://wordpress.org/plugins/category-posts-in-custom-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/category-posts-in-custom-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/category-posts-in-custom-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/category-posts-in-custom-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/category-posts-in-custom-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/category-posts-in-custom-menu/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/php-55-preg_replace-e-modifier-depricated/#post-4490585)
 * Status: resolved