Title: PHP 8 &#8211; wp_localize_script throws ErrorException
Last modified: February 12, 2021

---

# PHP 8 – wp_localize_script throws ErrorException

 *  [Daniel Sturm](https://wordpress.org/support/users/dsturm/)
 * (@dsturm)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/php-8-wp_localize_script-throws-errorexception/)
 * Hi,
 * running SVG Support (2.3.18) in PHP 8 (WordPress 5.6.1) will throw an ErrorException
 * `ErrorException: Only the first byte will be assigned to the string offset in
   file`
 * because of using a string as third parameter in [`wp_localize_script()`](http://developer.wordpress.org/reference/functions/wp_localize_script/)(…/
   plugins/svg-support/functions/enqueue.php:145) instead of an array.
 * See [https://github.com/dsturm/svg-support/tree/php-8](https://github.com/dsturm/svg-support/tree/php-8)
   for a possible fix.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-8-wp_localize_script-throws-errorexception/#post-14209788)
 * Hi there,
 * Thanks for pointing this out and providing a potential solution!
 * I’m hoping to have some time to work on this very soon!

Viewing 1 replies (of 1 total)

The topic ‘PHP 8 – wp_localize_script throws ErrorException’ is closed to new replies.

 * ![](https://ps.w.org/svg-support/assets/icon.svg?rev=3554681)
 * [SVG Support](https://wordpress.org/plugins/svg-support/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/svg-support/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/svg-support/)
 * [Active Topics](https://wordpress.org/support/plugin/svg-support/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/svg-support/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/svg-support/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/php-8-wp_localize_script-throws-errorexception/#post-14209788)
 * Status: not a support question