Undefined_constant: PHP 7 升级后出错

Undefined_constant: Error after PHP 7 upgrade

我有这个简单的 PHP 脚本 (authors.php) 以随机顺序轮换图像列表

<?php 
$random = mt_rand(1,9);
$image_1 = '<img src="/gallery/authors/1.jpg">';
$image_2 = '<img src="/gallery/authors/2.jpg">';
$image_3 = '<img src="/gallery/authors/3.jpg">';
$image_4 = '<img src="/gallery/authors/4.jpg">';
$image_5 = '<img src="/gallery/authors/5.jpg">';
$image_6 = '<img src="/gallery/authors/6.jpg">';
$image_7 = '<img src="/gallery/authors/7.jpg">';
$image_8 = '<img src="/gallery/authors/8.jpg">';
$image_9 = '<img src="/gallery/authors/9.jpg">';
echo ${image_.$random};
?>

在我从 PHP 5.6 升级到 PHP 7.2.34 之前一切正常。

现在我得到这个错误。

Use of undefined constant image_ - assumed 'image_' (this will throw an Error in a future version of PHP) in /home/website/public_html/authors.php, line 12

需要更改什么才能使此脚本正常工作?

谢谢

试试这个而不是长长的队伍

$random = mt_rand(1,9);
echo "<img src=\"/gallery/authors/{$random}.jpg\">";