PHP死掉了不同于我想要的错误消息

I have a Javascript function which calls a PHP script on my server. In case of failures, the JS function is expecting to receive a message of save_failed from the script.

For testing purposes, I put the wrong database info in the line below so that it fails:

mysql_connect("hostname", "user", "pass") or die('save_failed');

However, the JS function was not behaving as expected, and it seemed it wasn't receiving save_failed as the output. To confirm, I displayed the message being received as an alert box and this is what I got.

Why is the php script not throwing just save_failed and how can I make it do that?

JS function received msg

You have Xdebug installed and further errors are occurring.

In production, you should have error_reporting(0) and ini_set('display_errors', '0').