> However, for building applications that might get deployed somewhere, or talk to a database in a secure fashion, it's a nightmare.
In what decade? Ever heard of PDO? Prepared statements? PHP is actually more secure when it comes to database connections than all of the wonderful alternatives you mentioned.