Support » Plugin: Loco Translate » Got error (Notice) in PHP 8.0.0

  • Resolved 7o599


    Error message:
    spl_autoload_register(): Argument #2 ($do_throw) has been ignored, spl_autoload_register() will always throw


Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tim W


    Thanks for your report. This plugin has not yet been tested in PHP 8.

    I note that the PHP documentation has not yet been updated for spl_autoload_register with regard to this change in the function signature.

    PHP 8.0.0 was released less than a week ago and WordPress should be considered Beta compatible so I don’t recommend you put it into production right now.

    If my plugin works except for notices, then I suggest you suppress notices for the time being.

    I will leave this ticket open to track PHP8 compatibility and aim to look at this soon.

    Plugin Author Tim W


    Quick update to say that the spl_autoload_register error is fixed on the dev branch along with a couple of other PHP 8 fixes.

    I’m not saying the plugin is PHP 8 ready yet, so there may be further errors. I expect it to be fully tested by the time I release version 2.4.7 which hopefully will coincide with the imminent release of WordPress 5.6.

    Still an issue e.g. on /admin.php?page=loco-config&action=user

    When seeking help with this issue, you may be asked for some of the following information:
    WordPress version 5.7
    Current theme: Avada (version 7.3)
    Current plugin: Loco Translate (version 2.5.2)
    PHP version 8.0.2
    Error Details
    An error of type E_ERROR was caused in line 36 of the file /var/www/clients/client5/web29/web/wp-content/plugins/loco-translate/tpl/admin/config/prefs.php. Error message: Uncaught TypeError: implode(): Argument #1 ($pieces) must be of type array, string given in /var/www/clients/client5/web29/web/wp-content/plugins/loco-translate/tpl/admin/config/prefs.php:36
    Stack trace:
    #0 /var/www/clients/client5/web29/web/wp-content/plugins/loco-translate/tpl/admin/config/prefs.php(36): implode()
    #1 /var/www/clients/client5/web29/web/wp-content/plugins/loco-translate/src/mvc/View.php(271): include('...')
    #2 /var/www/clients/client5/web29/web/wp-content/plugins/loco-translate/src/mvc/View.php(220): Loco_mvc_View->execTemplate()
    #3 /var/www/clients/client5/web29/web/wp-content/plugins/loco-translate/src/mvc/View.php(207): Loco_mvc_View->buffer()
    #4 /var/www/clients/client5/web29/web/wp-content/plugins/loco-translate/src/mvc/AdminController.php(229): Loco_mvc_View->render()
    #5 /var/www/clients/client5/web29/web/wp-content/plugins/loco-translate/src/admin/config/PrefsController.php(46): Loco_mvc_AdminController->view()
    #6 /var/www/clients/client5/web29/web/wp-content/plugins/loco-translate/src/mvc/AdminRouter.php(243): Loco_admin_config_PrefsController->render()
    #7 /var/www/clients/client5/web29/web/wp-includes/class-wp-hook.php(292): Loco_mvc_AdminRouter->renderPage()
    #8 /var/www/clients/client5/web29/web/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters()
    #9 /var/www/clients/client5/web29/web/wp-includes/plugin.php(484): WP_Hook->do_action()
    #10 /var/www/clients/client5/web29/web/wp-admin/admin.php(259): do_action()
    #11 {main}
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Got error (Notice) in PHP 8.0.0’ is closed to new replies.