Skip to content

Instantly share code, notes, and snippets.

@sotarok
Created January 16, 2009 17:32
Show Gist options
  • Save sotarok/48022 to your computer and use it in GitHub Desktop.
Save sotarok/48022 to your computer and use it in GitHub Desktop.
--- dict_orig.php 2009-01-16 21:44:35.000000000 +0900
+++ dict.php 2009-01-17 01:35:08.000000000 +0900
@@ -15,19 +15,17 @@
$d = false;
$usage = null;
if ($argc > 1) {
- foreach ($argv as $key => $val) {
- if ($argv[$key] === basename(__FILE__)) {
- continue;
- } else if ($argv[$key] === '-c') {
+ foreach (array_slice($argv, 1) as $val) {
+ if ($val === '-c') {
// Classes
$c = true;
- } else if ($argv[$key] === '-f') {
+ } else if ($val === '-f') {
// Functions
$f = true;
- } else if ($argv[$key] === '-i') {
+ } else if ($val === '-i') {
// Interfaces
$i = true;
- } else if ($argv[$key] === '-d') {
+ } else if ($val === '-d') {
// Constants
$d = true;
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment