Something strange with ajax

add_action and add_filter always return true.

And yes, in PHP, any string that is not empty or “0” is loosely equal to the boolean true.

And I see nothing wrong with your die code. It’s hooked to wp_ajax_my_action, so you need to make a call to the admin-ajax.php as an authenticated user, with the my_action request. Then it will die.