Title: PHP ERRORS and FIXES
Last modified: March 27, 2023

---

# PHP ERRORS and FIXES

 *  Resolved [royrogers](https://wordpress.org/support/users/royrogers/)
 * (@royrogers)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/php-errors-and-fixes/)
 * Hi there,
 * I get these PHP Warnings :
 *     ```wp-block-code
       Warning	Undefined array key 0	3	    wp-content/plugins/mp3-music-player-by-sonaar/includes/class-sonaar-music.php:317	
       Plugin: mp3-music-player-by-sonaarWarning	Trying to access array offset on value of type null	3	wp-content/plugins/mp3-music-player-by-sonaar/includes/class-sonaar-music.php:317 
   
   
       Warning	Undefined array key 0	1	    wp-content/plugins/mp3-music-player-by-sonaar/includes/class-sonaar-music-widget.php:215	Plugin: mp3-music-player-by-sonaarWarning	Trying to access array offset on value of type null	1	wp-content/plugins/mp3-music-player-by-sonaar/includes/class-sonaar-music-widget.php:215
       ```
   
 * How I fixed:
 *     ```wp-block-code
        // $fileOrStream =  $album_tracks[0]['FileOrStream'];
       $fileOrStream = $album_tracks[0]['FileOrStream'] ?? null;
       ```
   
    -  This topic was modified 3 years, 2 months ago by [royrogers](https://wordpress.org/support/users/royrogers/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [sonaar](https://wordpress.org/support/users/sonaar/)
 * (@sonaar)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-errors-and-fixes/#post-16632959)
 * Hi,
   Thanks for reporting.
 * ​I can’t seem to be able to reproduce it on my end. Is the playlist post had 
   a tracklist set when this error shown up?
   If you still have issues, let me know.
 *  Thread Starter [royrogers](https://wordpress.org/support/users/royrogers/)
 * (@royrogers)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-errors-and-fixes/#post-16638809)
 * This happens with or without a playlist.
 * Anyway, I think you should always check for the array key in your PHP code. It
   maybe doesn’t show the error for you, but may show for others. I use PHP 8.0.22
    -  This reply was modified 3 years, 1 month ago by [royrogers](https://wordpress.org/support/users/royrogers/).
 *  Thread Starter [royrogers](https://wordpress.org/support/users/royrogers/)
 * (@royrogers)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-errors-and-fixes/#post-16656528)
 * You can see the error here (Query Monitor)
 * [https://pasteboard.co/kJ06Psi40Hyy.jpg](https://pasteboard.co/kJ06Psi40Hyy.jpg)
    -  This reply was modified 3 years, 1 month ago by [royrogers](https://wordpress.org/support/users/royrogers/).
 *  Plugin Author [sonaar](https://wordpress.org/support/users/sonaar/)
 * (@sonaar)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-errors-and-fixes/#post-16656676)
 * Thanks. we have fixed it and we should release a plugin update this weekend or
   in the beginning of next week (4.5.1)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP ERRORS and FIXES’ is closed to new replies.

 * ![](https://ps.w.org/mp3-music-player-by-sonaar/assets/icon.svg?rev=1865553)
 * [MP3 Audio Player – Music Player, Podcast Player & Radio by Sonaar](https://wordpress.org/plugins/mp3-music-player-by-sonaar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mp3-music-player-by-sonaar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mp3-music-player-by-sonaar/)
 * [Active Topics](https://wordpress.org/support/plugin/mp3-music-player-by-sonaar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mp3-music-player-by-sonaar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mp3-music-player-by-sonaar/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [sonaar](https://wordpress.org/support/users/sonaar/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/php-errors-and-fixes/#post-16656676)
 * Status: resolved