PHP Fatal error: Uncaught Error: Call to undefined function create_function() in ...
Please upgrade version on https://wordpress.org/plugins/wp-syntax/ , as I guess the issue will impact more and more users as they upgrade to PHP 8. Debian stable (bookworm) comes now with PHP 8.2.
The version of this plugin currently released on https://wordpress.org/plugins/wp-syntax/ has the
geshi.php
version that usescreate_function
, which unfortunately fails with PHP 8 (that removed create_function, https://www.php.net/manual/en/function.create-function.php ).I found that latest version of
geshi.php
, 1.0.9.1, from https://github.com/GeSHi/geshi-1.0/blob/master/src/geshi.php , has this issue fixed.Then I found that actually this repository also already has a fix, https://github.com/shazahm1/WP-Syntax/commit/4fe9a200b14b369a6b43b36f18ca2cb1f1afeb2c :) So, while I would advise to upgrade to GeSHi 1.0.9.1 (to rely on GeSHi code used also by other frameworks, like Drupal), the practical problem is also already fixed here.
But the https://wordpress.org/plugins/wp-syntax/ doesn't contain this fix. Although it says "Last updated:8 months ago" (so after the commit https://github.com/shazahm1/WP-Syntax/commit/4fe9a200b14b369a6b43b36f18ca2cb1f1afeb2c ), but the contents downloaded from https://downloads.wordpress.org/plugin/wp-syntax.1.1.zip contain
geshi.php
withcreate_function
used. And it indeed fails with PHP 8, e.g. when trying to use this code in Wordpress post:it will fail with PHP error
Please upgrade version on https://wordpress.org/plugins/wp-syntax/ , as I guess the issue will impact more and more users as they upgrade to PHP 8. Debian stable (bookworm) comes now with PHP 8.2.