Replies: 0
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];
}