I'm getting error with Symfony 1.4 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /vagrant/lib/util/sfToolkit.class.php on line 365
The function concerned is below:
public static function pregtr($search, $replacePairs)
{
if(strpos(implode(', ', $replacePairs),'e') > 0)
print_r($replacePairs);
return preg_replace(array_keys($replacePairs),array_values($replacePairs), $search);
}
The values concerned is:
Array
(
[#/(.?)#e] => '::'.strtoupper('\1')
[/(^|_|-)+(.)/e] => strtoupper('\2')
)
How can I change this to what is equivalent using preg_replace_callback
?