Title: Quick PHP warning fix
Last modified: October 31, 2018

---

# Quick PHP warning fix

 *  [peterjanes](https://wordpress.org/support/users/peterjanes/)
 * (@peterjanes)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/quick-php-warning-fix/)
 *     ```
       if ( is_array( $photos ) ) {
       	$first_photo = array_pop( array_reverse( $photos ) );
       }
       ```
   
 * causes a PHP Strict warning about passing by reference. I believe this is equivalent
   and supported in all PHP releases:
 *     ```
       if ( is_array( $photos ) && count( $photos ) > 0 ) {
       	$first_photo = array_values( $photos )[0];
       }
       ```
   
    -  This topic was modified 7 years, 6 months ago by [peterjanes](https://wordpress.org/support/users/peterjanes/).
      Reason: code formatting

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

 *  [Khürt Williams](https://wordpress.org/support/users/khurtwilliams/)
 * (@khurtwilliams)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/quick-php-warning-fix/#post-11055000)
 * Perhaps you can submit that via GitHub?
 *  Thread Starter [peterjanes](https://wordpress.org/support/users/peterjanes/)
 * (@peterjanes)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/quick-php-warning-fix/#post-11056002)
 * I missed the GitHub link in the readme, just saw the SVN repo on the plugin page.
   Looks like you made a better version of the change earlier today anyway… thanks!

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

The topic ‘Quick PHP warning fix’ is closed to new replies.

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

 * 2 replies
 * 2 participants
 * Last reply from: [peterjanes](https://wordpress.org/support/users/peterjanes/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/quick-php-warning-fix/#post-11056002)
 * Status: not resolved