CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.

YesSoftware Forums -> CodeCharge Studio -> PHP

 Deprecated: preg_replace():

Print topic Send  topic

Author Message

Posts: 2
Posted: 04/14/2014, 4:28 AM

Just upgraded my local development site to; Apache 2.4.7 - mySQL 5.6.15 - PHP 5.5.8 and having a problem with Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\motordiscounts\Template.php on line 92

does anybody know how to fix this?
View profile  Send private message

Posts: 1
Posted: 06/16/2014, 6:53 PM

You solved this problem ?
View profile  Send private message

Posts: 24
Posted: 06/17/2014, 3:19 PM

yes preg_replace(): is depreciated in the new version of php however it still seems to function ok the error shows up in the template php area I don't use templates or the default css if you disable error reporting it will disappear
View profile  Send private message

Posts: 2
Posted: 06/17/2014, 4:58 PM

Yes you have 2 choices

Downgrade to PHP 5.4.24 or Set your templates, but I was still finding issues and errors

If you disable error reporting which also affect other reporting and I found problems their

There is no simple solution for PHP 5.5.8
View profile  Send private message

Posts: 14
Posted: 05/15/2015, 5:35 AM

Someone already tried to modify the CodeCharge files generated by putting in place this function preg_replace_callback function ()
Lucas Leandro de Moura
PHP Programmer
Estrela/RS - Brazil
View profile  Send private message

Posts: 64
Posted: 05/21/2015, 2:31 AM

I don't have tried but I think it's also possible to use php function_exists() to check if preg_replace() is implementend in your PHP environment.
Something like this pseudo-code:

if (! function_exists('preg_replace')) {
include 'my_preg_replace.php';

File my_preg_replace.php should be like this:

function preg_replace($pattern, $replacement, $subject, $limit, $count){
// custom implementation by using php 5.5 preg_replace_callback if you
// are using PHP 5.5.

View profile  Send private message

Posts: 64
Posted: 05/23/2015, 4:50 PM

Another possible solution

override_function('preg_replace', $pattern, $replacement, $subject,$limit,$count,
'return my_preg_replace($pattern, $replacement, $subject, $limit, $count);');

function my_preg_replace($pattern, $replacement, $subject, $limit, $count){
// custom implementation by using php 5.5 preg_replace_callback if you
// are using PHP 5.5.

View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.