This occurs because you do the explode()
call inside the next()
call. The reason I think is, by strict standards you shouldn’t pass a function to a function like this, because, like @AndrewBartel said, of reference, which would be missing. Doing it like shown below should work and would be correct:
$nval = explode( '/themes/', $stylesheet_directory_uri );
$wp_theme_name = next( $nval );