Re: New years resolution: To get serious with my programming! Anyone wanna help? :)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Lynch schreef:

On Tue, January 8, 2008 3:40 pm, Jack Mays wrote:
funnily enough exit is even listed as a function.


Sure it is: http://us2.php.net/manual/en/function.exit.php

Unless I'm missing a point here or something. :)

Technically, exit is "language construct" and not a function.

It does not require the () at the end.

There are more than a few "language constructs" that are documented
just like functions because 99% of the time, nobody cares that they
aren't functions.

Some common ones:

require
include
isset
exit
die ??? (maybe this one IS a function)

an alias of exit afaict/afaik.

echo
print (used to be a function, maybe still is?)

There are a few places where these not being functions makes a
difference in your life, but for the most part, it doesn't really...

But exit(); makes you look like a newbie for not knowing it's not
really a function and you don't need the ()s unless you want a return
error code.

funny that, I usually use 'exit;' for a clean exit and 'die();' to signify
a shitty exit ... although they are actually indentical functionally - just
my idiosyncrasity ... that said I also so stuff like 'exit(1);' when I really
want to offer a proper exit code. :-/



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux