<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Wordpress - Codecolorer - Fix create_function() is deprecated error when moving to PHP 8.x - Web Development				            </title>
            <link>https://www.tweaking4all.com/forum/web-development/wordpress-codecolorer-fix-create_function-is-deprecated-error-when-moving-to-php-8-x/</link>
            <description>Tweaking4All.com Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Thu, 12 Nov 2026 13:23:06 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Wordpress - Codecolorer - Fix create_function() is deprecated error when moving to PHP 8.x</title>
                        <link>https://www.tweaking4all.com/forum/web-development/wordpress-codecolorer-fix-create_function-is-deprecated-error-when-moving-to-php-8-x/#post-4646</link>
                        <pubDate>Thu, 02 Feb 2023 15:11:16 +0000</pubDate>
                        <description><![CDATA[When moving my website from PHP 7.x to 8.x, the CodeColorer plugin that I use, started crashing saying that &quot;create_function() is deprecated&quot; (see also PHP manual where I also found how to m...]]></description>
                        <content:encoded><![CDATA[<p>When moving my website from PHP 7.x to 8.x, the <strong>CodeColorer</strong> plugin that I use, started crashing saying that "<strong>create_function() is deprecated</strong>" (see also <a href="https://www.php.net/manual/en/function.create-function" target="_blank" rel="noopener">PHP manual</a> where I also found how to make a fix for this issue). Thank goodness, the fix wasn't super difficult.</p>
<p>In this file</p>
<pre contenteditable="false">/wp-content/plugins/codecolorer/geshi.php</pre>
<p>Goto line 4697 and look at the "if" statement.</p>
<pre contenteditable="false">if (!isset($callback_2)) {
  $callback_2 = create_function('$matches', 'return "[" . str_replace("|", "", $matches) . "]";');
}</pre>
<p>which I changed (line 4698) to:</p>
<pre contenteditable="false">if (!isset($callback_2)) {
  // old: $callback_2 = create_function('$matches', 'return "[" . str_replace("|", "", $matches) . "]";');
  $callback_2 = function($matches) { return "[" . str_replace("|", "", $matches) . "]"; };
}</pre>
<p>For me the plugin now works as before.</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/web-development/">Web Development</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/web-development/wordpress-codecolorer-fix-create_function-is-deprecated-error-when-moving-to-php-8-x/#post-4646</guid>
                    </item>
							        </channel>
        </rss>
		