Untitled


SUBMITTED BY: Guest

DATE: Oct. 9, 2012, 8:51 a.m.

FORMAT: PHP

SIZE: 567 Bytes

HITS: 1567

  1. <?php
  2. /*
  3. * Let's say I have defined $settings and I'm storing
  4. * a password in $settings['password'] in the file config.inc.php
  5. */
  6. include('config.inc.php');
  7. // Now I'm using this password in a class
  8. class my_class {
  9. private $password;
  10. // and I've defined it as private
  11. private function __construct() {
  12. global $settings;
  13. $password = $settings['password'];
  14. // Does it make the application more secure, if I unset $settings now?
  15. unset($settings);
  16. }
  17. }
  18. ?>

comments powered by Disqus