I recently migrated from php5.2.6 to php5.6.22 and now I am getting this error.
Unkwown error. 8192: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
Seems that preg_replace
is deprecated in php5.6++
http://php.net/manual/en/migration55.deprecated.php
Here is whole function where I am using `preg_replace function:
function mb_unserialize( $serial_str ) {
$out = preg_replace( '!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $serial_str );
return unserialize( $out );
}
Could someone explain how should I implement preg_replace_callback
function with this type of pattern? And how does preg_replace_callback
works in this situation?
Thanks