{"id":16488578,"date":"2023-02-20T17:19:41","date_gmt":"2023-02-20T17:19:41","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/error-on-php-8-0-cannot-access-offset-of-type-string\/"},"modified":"2023-02-20T17:19:41","modified_gmt":"2023-02-20T17:19:41","slug":"error-on-php-8-0-cannot-access-offset-of-type-string","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/error-on-php-8-0-cannot-access-offset-of-type-string\/","title":{"rendered":"Error on php 8.0: Cannot access offset of type string"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I have the following error when I use the plugin on php 8.0, on php 7.4 it&#8217;s just a warning and everything works fine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Error log:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in \/Applications\/MAMP\/htdocs\/wordpress-total-estate\/wp-content\/plugins\/kaya-qr-code-generator\/lib\/class.shortcodes_qrcodeshortcode.php:50<br \/>Stack trace:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>0 \/Applications\/MAMP\/htdocs\/wordpress-total-estate\/wp-includes\/shortcodes.php(355): WPKQCG_Shortcodes_qrcodeshortcode::wpkqcg_shortcode_qrcodeshortcodedynamic_handler(&#8221;, &#8216;[example_shortc\u2026&#8217;, &#8216;kaya_qrcode_dyn\u2026&#8217;)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1 [internal function]: do_shortcode_tag(Array)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2 \/Applications\/MAMP\/htdocs\/wordpress-total-estate\/wp-includes\/shortcodes.php(227): preg_replace_callback(&#8216;\/\\[(\\[?)(kaya_q\u2026&#8217;, &#8216;do_shortcode_ta\u2026&#8217;, &#8216;[kaya_qrcode_dy\u2026&#8217;)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3 \/Applications\/MAMP\/htdocs\/wordpress-total-estate\/wp-content\/themes\/centurytwentyonetotalestate\/single-agents.php(170): do_shortcode(&#8216;[kaya_qrcode_dy\u2026&#8217;)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4 \/Applications\/MAMP\/htdocs\/wordpress-total-estate\/wp-includes\/template-loader.php(106): include(&#8216;\/Applications\/M\u2026&#8217;)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5 \/Applications\/MAMP\/htdocs\/wordpress-total-estate\/wp-blog-header.php(19): require_once(&#8216;\/Applications\/M\u2026&#8217;)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>6 \/Applications\/MAMP\/htdocs\/wordpress-total-estate\/index.php(17): require(&#8216;\/Applications\/M\u2026&#8217;)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>7 {main}<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">thrown in \/Applications\/MAMP\/htdocs\/wordpress-total-estate\/wp-content\/plugins\/kaya-qr-code-generator\/lib\/class.shortcodes_qrcodeshortcode.php on line 50<\/p>\n","protected":false},"template":"","class_list":["post-16488578","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16488578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16488578\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16488578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}