Title: Great until PHP 8
Last modified: March 19, 2022

---

# Great until PHP 8

 *  [ober0330](https://wordpress.org/support/users/ober0330/)
 * (@ober0330)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/great-until-php-8/)
 * It works great except if you try to upgrade to PHP 8. The author uses {} to access
   some data elements instead of the standard []. You can fix it pretty easily but
   it would also be wonderful if the plugin was updated to fix this minor thing.
   I’d happily contribute a PR if the author had the code publicly somewhere (Github/
   etc.).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [whusnoopy](https://wordpress.org/support/users/whusnoopy/)
 * (@whusnoopy)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/great-until-php-8/#post-15916738)
 * I’m looking for the fix but not know PHP too much, is it ok to share the changes
   with gist or somewhere like it?
 *  Thread Starter [ober0330](https://wordpress.org/support/users/ober0330/)
 * (@ober0330)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/great-until-php-8/#post-15917123)
 * I don’t remember where all the changes were. Basically anywhere you have an array
   using blah{x}, just switch it to blah[x]. Or just run the plugin in a PHP 8 environment,
   you’ll see it pretty quick.
 *  [whusnoopy](https://wordpress.org/support/users/whusnoopy/)
 * (@whusnoopy)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/great-until-php-8/#post-15966013)
 * I’ve tried to find any array using `{}` in `wp-content/plugins/collapse-archives/`
 * None of them use incorrect `{}` which should be `[]`
 * According to the error message, it says
 * `2022/08/31 16:01:50 [error] 1088#1088: *266661 FastCGI sent in stderr: "PHP 
   message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument#
   1 ($callback) must be a valid callback, class collapsArch does not have a method"
   enqueue_scripts" in /home/foo/www/blog/wp-includes/class-wp-hook.php:307`
 * seems like it crashed because WordPress changed the way to call plugin? This 
   plugin register in an incorrect way?
 *  [deborahfitchett](https://wordpress.org/support/users/deborahfitchett/)
 * (@deborahfitchett)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/great-until-php-8/#post-16349890)
 * For the “enqueue_scripts” error, [@usuari0](https://wordpress.org/support/users/usuari0/)’
   s solution in [https://wordpress.org/support/topic/an-error-occurred-11/](https://wordpress.org/support/topic/an-error-occurred-11/)
   worked for me.
 * After fixing that, I still had the issue where upgrading to PHP 8.x resulted 
   in WordPress displaying as a completely blank page – not even any errors in the
   logs. Like [@whusnoopy](https://wordpress.org/support/users/whusnoopy/) I couldn’t
   find any instances of arrays using blah{x} but while I was combing through all
   the files I did discover a typo in defaults.php where line 27 had ‘taxoncmy’.
   Correcting this to ‘taxonomy’ (as referred to in other files) resolved the issue
   and I was able to upgrade to PHP 8.1 successfully.
 *  [whusnoopy](https://wordpress.org/support/users/whusnoopy/)
 * (@whusnoopy)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/great-until-php-8/#post-16350102)
 * Thanks to [@deborahfitchett](https://wordpress.org/support/users/deborahfitchett/),
   it works after fix the typo
 * There are two places need to fix
 * change line 42 on `/wp-content/plugins/collapsing-archives/collapsArch.php` from
 *     ```wp-block-code
       if (!is_admin()) {
           wp_enqueue_script('jquery');
           add_action( 'wp_enqueue_scripts', array( 'collapsArch', 'enqueue_scripts' ) );
       } else {
       ```
   
 * to
 *     ```wp-block-code
       if (!is_admin()) {
           wp_enqueue_script('jquery');
           add_action( 'wp_head', array( 'collapsArch', 'get_head' ) );
       } else {
       ```
   
 * and change line 27 on `/wp-content/plugins/collapsing-archives/defaults.php` 
   from
 *     ```wp-block-code
       'post_type' => 'post',
       'taxoncmy' => 'category',
       'postTitleLength' => '');
       ```
   
 * to
 *     ```wp-block-code
       'post_type' => 'post',
       'taxonomy' => 'category',
       'postTitleLength' => '');
       ```
   
    -  This reply was modified 3 years, 3 months ago by [whusnoopy](https://wordpress.org/support/users/whusnoopy/).

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Great until PHP 8’ is closed to new replies.

 * ![](https://ps.w.org/collapsing-archives/assets/icon-256x256.gif?rev=2550328)
 * [Collapsing Archives](https://wordpress.org/plugins/collapsing-archives/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/collapsing-archives/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/collapsing-archives/)
 * [Active Topics](https://wordpress.org/support/plugin/collapsing-archives/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/collapsing-archives/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/collapsing-archives/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [whusnoopy](https://wordpress.org/support/users/whusnoopy/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/great-until-php-8/#post-16350102)