I sincerely doubt that. PHP has fundamental issues.
It's like the people 10 years ago saying "if [other OS] was as popular as Windows XP, it'd be overrun with malware too". No. The issue wasn't Windows marketshare, it was the completely crap security.
The issue was both Windows marketshare and crap security. If it wasn't easy to write malware for Windows not as many would write it. If there was no one to infect with the malware, also no one would write it.