My apologies if this has been brought up before, but I searched the
archives and couldn't find a reference to it.

I'm sure this is the sort of thing that would have already been
implemented if there was any desire for it among the developers, but I
was wondering if anyone had considered adding support for an "unless"
control structure, similar to the one Perl has.  I personally find it
much more logical in certain cases.  For example, compare this:

if (!$user->isAdministrator) {
  header('Location: ...');
  exit;
}

With this:

unless ($user->isAdministrator) {
  header('Location: ...');
  exit;
}

I think the second one is much easier to read.  I strive to write code
that is self-documenting, so I tend to pick variable names and
function names that are pretty self explanatory.  I think an "unless"
control structure would go a long way to helping people write
self-documenting code.

Just a thought, sorry if this is not the proper forum for this sort of
thing.

--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to