title: replacing create_function() with something else for PHP8
body: <p>So I have a plugin that was working fine previously, but for a few days now it is throwing me an error as:</p>
  <blockquote>
  <p>PHP Fatal error:  Uncaught Error: Call to undefined function create_function()</p>
  </blockquote>
  <p>After a bit of searching, I found out that this is because <code>create_function()</code> is deprecated in PHP 8.</p>
  <p>Now the exact line that causes the issue is this:</p>
  <pre><code>$callback_2 = create_function('$matches', 'return &quot;[&quot; . str_replace(&quot;|&quot;, &quot;&quot;, $matches[1]) . &quot;]&quot;;');
  </code></pre>
  <p>I tried changing this to:</p>
  <pre class="lang-php prettyprint-override"><code>$callback_2 = function(){
   ('$matches', return &quot;[&quot; . str_replace(&quot;|&quot;, &quot;&quot;, $matches[1]) . &quot;]&quot;;);
  }
  </code></pre>
  <p>But it's not working. So it would be great if someone could point me in the right direction also I am very new to PHP.</p>