get_the_tags()
returns an array or false
on failure. (It appears it may also return a WP_Error
object under certain circumstances.)
It also requires a parameter: the post ID. You’re not passing that, so you’re not going to get the array your code expects.
Edit
You can’t just call get_the_tags()
— that’ll just get you a value of false
. You need to provide a post ID.
This might work: replace
$asrtags = get_the_tags();
with
$asrtags = get_the_tags( get_the_ID() );
…but note that this will only work if you’re in The Loop.