title: Curly braces Fatal Errors after PHP 8 update
body: <p>I've got a WordPress site that makes heavy use of a plugin, NextEnd Accordion Menu, which is no longer maintained.  It still works great with each new version of WordPress and I'd like to stick to it if possible.  But when I test a site update from PHP 7.3 to 8, the plugin breaks.  Eventually I am going to have to go to PHP 8, so I'm trying to prepare for that time.</p>
  <p>I think I've found what needs to be fixed, as in the error logs I see fatal errors--&quot;Array and string offset access syntax with curly braces is no longer supported.&quot;  When I look at the lines triggering the errors, I can see an easy fix for most of them.</p>
  <p>For four out of five of the errors, it's just a matter of changing something like</p>
  <pre><code>if ($tag{0} == $this-&gt;lessc-&gt;vPrefix)
  </code></pre>
  <p>to</p>
  <pre><code>if ($tag[0] == $this-&gt;lessc-&gt;vPrefix)
  </code></pre>
  <p>But for the last error the problem is on the elseif line here:</p>
  <pre><code>protected function end() {
          if ($this-&gt;literal(';')) {
              return true;
          } elseif ($this-&gt;count == strlen($this-&gt;buffer) || $this-&gt;buffer{$this-&gt;count} == '}') {
              // if there is end of file or a closing block next then we don't need a ;
              return true;
          }
          return false;
      }
  </code></pre>
  <p>That <code>$this-&gt;buffer{$this-&gt;count}</code> seems to be the offending item, but I am way beyond my depth in figuring out how to change it.</p>
  <p>I tried changing the curly braces to square braces, to parentheses, to double curly braces, and in each case it just caused more and different errors.</p>
  <p>Trying the square braces
  <code>$this-&gt;buffer[$this-&gt;count]</code></p>
  <p>Gives me this more complicated and opaque to me new error:</p>
  <pre><code>PHP Fatal error:  Uncaught TypeError: array_merge(): Argument #2 must be of type array, null given in /nas/content/live/stagingsitexray/wp-content/plugins/nextend-accordion-menu/nextend/parse/font.php:27\nStack trace:\n#0 /nas/content/live/stagingsitexray/wp-content/plugins/nextend-accordion-menu/nextend/parse/font.php(27): array_merge(Array, NULL)\n#1 /nas/content/live/stagingsitexray/wp-content/plugins/nextend-accordion-menu/themes/default/default/context.php(39): NextendParseFont-&gt;mixinTab('Active')\n#2 /nas/content/live/stagingsitexray/wp-content/plugins/nextend-accordion-menu/library/accordionmenu/menu.php(161): include('/nas/content/li...')\n#3 /nas/content/live/stagingsitexray/wp-content/plugins/nextend-accordion-menu/library/accordionmenu/wordpress/menu.php(67): NextendMenu-&gt;addCSS()\n#4 /nas/content/live/stagingsitexray/wp-content/plugins/nextend-accordion-menu/library/accordionmenu/menu.php(56): NextendMenuWordpress-&gt;addCSS()\n#5 /nas/content/live/stagingsitexray/wp-content/plugins/nextend-accordion-menu/widget.php(62): NextendMenu-&gt;render()\n#6 /nas/content/live/stagingsitexray/wp-includes/class-wp-widget.php(393): NextendAccordionMenuWidget-&gt;widget(Array, Array)\n#7 /nas/content/live/stagingsitexray/wp-includes/widgets.php(835): WP_Widget-&gt;display_callback(Array, Array)\n#8 /nas/content/live/stagingsitexray/wp-content/themes/customizr/sidebar-left.php(13): dynamic_sidebar('left')\n#9 /nas/content/live/stagingsitexray/wp-includes/template.php(770): require_once('/nas/content/li...')\n#10 /nas/content/live/stagingsitexray/wp-includes/template.php(716): load_template('/nas/content/li...', true, Array)\n#11 /nas/content/live/stagingsitexray/wp-includes/general-template.php(136): locate_template(Array, true, true, Array)\n#12 /nas/content/live/stagingsitexray/wp-content/themes/customizr/inc/czr-front-ccat.php(7650): get_sidebar('left')\n#13 /nas/content/live/stagingsitexray/wp-includes/class-wp-hook.php(307): CZR_sidebar-&gt;czr_fn_render_sidebar('')\n#14 /nas/content/live/stagingsitexray/wp-includes/class-wp-hook.php(331): WP_Hook-&gt;apply_filters('', Array)\n#15 /nas/content/live/stagingsitexray/wp-includes/plugin.php(476): WP_Hook-&gt;do_action(Array)\n#16 /nas/content/live/stagingsitexray/wp-content/themes/customizr/index.php(28): do_action('__before_articl...')\n#17 /nas/content/live/stagingsitexray/wp-includes/template-loader.php(106): include('/nas/content/li...')\n#18 /nas/content/live/stagingsitexray/wp-blog-header.php(19): require_once('/nas/content/li...')\n#19 /nas/content/live/stagingsitexray/index.php(17): require('/nas/content/li...')\n#20 {main}\n  thrown in /nas/content/live/stagingsitexray/wp-content/plugins/nextend-accordion-menu/nextend/parse/font.php on line 27, referer: https://stagingsitexray/wp-admin/edit.php?post_type=page
  </code></pre>
  <p>(those are a bunch of other files, not the one I'm currently editing, which is /nas/content/live/stagingsitexray/wp-content/plugins/nextend-accordion-menu/nextend/css/less.php</p>