Title: PHP error &#8220;Warning: Uninitialized string offset 1&#8221;
Last modified: March 22, 2021

---

# PHP error “Warning: Uninitialized string offset 1”

 *  Resolved [Grasboom](https://wordpress.org/support/users/grasboom/)
 * (@grasboom)
 * [5 years ago](https://wordpress.org/support/topic/php-error-warning-uninitialized-string-offset-1/)
 * In my website error report (Sentry) I get this error on multiple Loco Translate
   PHP files:
    Warning: Uninitialized string offset 1
 * Example: /loco-translate/lib/compiled/gettext.php in loco_parse_wp_comment at
   line 36
 * To avoid this error, for example, put `! empty( $block[1] )` before `$block[1]`.
 * Can you fix this in the next update? That would prevent many unnecessary error
   reports.
 * Thanks in advance.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [5 years ago](https://wordpress.org/support/topic/php-error-warning-uninitialized-string-offset-1/#post-14218433)
 * To get this error would require the first comment in a file to be an empty `#`
   symbol. Pretty rare, but I can reproduce it and have fixed it in trunk.
 * Thanks for reporting.

Viewing 1 replies (of 1 total)

The topic ‘PHP error “Warning: Uninitialized string offset 1”’ is closed to new 
replies.

 * ![](https://ps.w.org/loco-translate/assets/icon-256x256.png?rev=1000676)
 * [Loco Translate](https://wordpress.org/plugins/loco-translate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/loco-translate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/loco-translate/)
 * [Active Topics](https://wordpress.org/support/plugin/loco-translate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/loco-translate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/loco-translate/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [Uninitialized string offset](https://wordpress.org/support/topic-tag/uninitialized-string-offset/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 1 reply
 * 2 participants
 * Last reply from: [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/php-error-warning-uninitialized-string-offset-1/#post-14218433)
 * Status: resolved