Skip to content

Instantly share code, notes, and snippets.

@shipleyr
Created November 17, 2014 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shipleyr/ad8ba2150854da106e93 to your computer and use it in GitHub Desktop.
Save shipleyr/ad8ba2150854da106e93 to your computer and use it in GitHub Desktop.
Application Config
//===========================================
// Gives a can't use return value in write context error
isset($vhm->getServiceLocator()->get('Config')['somevalue']);
//===========================================
// Is this not wasteful?
$config = $vhm->getServiceLocator()->get('Config');
//===========================================
// It's a copy not a reference...
$config = $vhm->getServiceLocator()->get('Config');
$config['somevalue'] = $anotherValue;
$config2 = $vhm->getServiceLocator()->get('Config');
// Thesse are not the same...
$config['somevalue'] == $config2['somevalue']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment