Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@johnroyer
Created September 15, 2017 05:52
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 johnroyer/52990142c1663fe153b85875c540a9cd to your computer and use it in GitHub Desktop.
Save johnroyer/52990142c1663fe153b85875c540a9cd to your computer and use it in GitHub Desktop.
env-config-comparison
<?php
$valid = [
'production' => '10.0.1.0/24',
'stage' => '10.0.1.0/24', // 和 production 重複
'dev' => '192.168.1.0/24',
];
<?php
$valid = [];
switch (ENV) {
case 'production':
case 'stage':
$valid[] = '10.0.1.0/24';
break;
case 'dev':
$valid[] = '192.168.1.0/24';
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment