Title: PHP 8 Error / Incompatibility
Last modified: August 19, 2022

---

# PHP 8 Error / Incompatibility

 *  Resolved [bekind](https://wordpress.org/support/users/pkverma99/)
 * (@pkverma99)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/php-8-error-incompatibility/)
 * Dear Support – Thanks for building this wonderful plugin. We recently encountered
   an error as below
    ====== “Fatal error: Uncaught Error: imagecreatetruecolor():
   Argument #1 ($width) must be of type int, string given in /wp-content/plugins/
   leira-letter-avatar/public/class-leira-letter-avatar-public.php on line 644” 
   =====
 * It seems to be php 8 issue and the plugin need to explicitly cast $width value
   to integer to fix the issue. I was able to fix it by changing line 575 of wp-
   content/plugins/leira-letter-avatar/public/class-leira-letter-avatar-public.php
 * from
    $size = isset( $data[‘size’] ) ? $data[‘size’] : 2;
 * to
    $size = isset( $data[‘size’] ) ? intval($data[‘size’]) : 2;
 * But we don’t want to change any code in the plugin, so would be great if you 
   can patch and issue an upgraded plugin.
 * Thanks again for building this wonderful plugin and sharing it with the community.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Ariel](https://wordpress.org/support/users/arielhr1987/)
 * (@arielhr1987)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/php-8-error-incompatibility/#post-15956405)
 * Hi [@pkverma99](https://wordpress.org/support/users/pkverma99/)
 * Thanks for sharing the error and the fix for it.
    I have released a new version
   of the plugin with the fix
 * Kind regards!

Viewing 1 replies (of 1 total)

The topic ‘PHP 8 Error / Incompatibility’ is closed to new replies.

 * ![](https://ps.w.org/leira-letter-avatar/assets/icon-256x256.jpg?rev=2380873)
 * [Leira Letter Avatar](https://wordpress.org/plugins/leira-letter-avatar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/leira-letter-avatar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/leira-letter-avatar/)
 * [Active Topics](https://wordpress.org/support/plugin/leira-letter-avatar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/leira-letter-avatar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/leira-letter-avatar/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ariel](https://wordpress.org/support/users/arielhr1987/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/php-8-error-incompatibility/#post-15956405)
 * Status: resolved