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