I don't understand why you even store the secret information in an array. Or why you get it from the database. But ok, if you use it somewhere else in the script there is a reason to store the value.
To your real question. This seems perfectly safe. Some things could happen, but it should not affect that value. What can happen is basically:
1. Everything works as it is supposed to be. The value is not visible.
2. The webserver does not work. Nothing is shown to the user or parsed, perfectly safe.
3. PHP does not work. The user will see the PHP code, but since it does not work they can't see what value it should be.
4. The RDBMS does not work. The array will be empty.
Other security threats are for example database injection, poor passwords, passwords that can be seen by the users and settings that compromizes the server. Also to output error messages to the client on the production server is a security risk.