What Exploit Are These User Agents Trying to Use?

I just looked at my user agent tracking page on my site (archived on Yandex) and I noticed these user agents. I believe they are an attempt to exploit my server (NGinx with PHP). The 1 in front of it is just how many times the user agent was seen in the NGinx log. These are also shortened user agents and not long ones like Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36. I no longer have access to the logs as I presume this occurred sometime in January or February (my oldest logs are in March and I created the site in January).

1 Mozilla/5.9}print(238947899389478923-34567343546345);{ 1 Mozilla/5.9{$  {print(238947899389478923-34567343546345)}} 1 Mozilla/5.9\x22{$  {print(238947899389478923-34567343546345)}}\x22 1 Mozilla/5.9\x22];print(238947899389478923-34567343546345);// 1 Mozilla/5.9\x22 

What exploit was attempted and how can I test to ensure these exploits are not usable?