GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Perl is to die as PHP is to ______ (https://gfy.com/showthread.php?t=127626)

cluck 04-23-2003 01:47 PM

Perl is to die as PHP is to ______
 
I'm just finishing up a script here and I realized that I have no idea how to completely halt execution of a script in php. Is there a way to do so like die() in perl?

cluck 04-23-2003 01:50 PM

As a little incentive, when I finish this script GFY gets a present :glugglug

StupidNewbie 04-23-2003 01:52 PM

exit

cluck 04-23-2003 01:53 PM

Quote:

Originally posted by StupidNewbie
exit
You rock.

tp347 04-23-2003 01:53 PM

exit()

http://www.php.net/manual/en/function.exit.php

Sin_Vraal 04-23-2003 01:53 PM

dunno maybe you could write you own tho:
This is more or less what die does:

##Convert to php
sub die ($) {
print STDERR "$_\n";
exit(1);
}

Libertine 04-23-2003 01:54 PM

die() also works in php.

Sin_Vraal 04-23-2003 01:54 PM

Quote:

Originally posted by StupidNewbie
exit

Die is an error should technically be exit(1), although nobody ever checks the return code anyway lol.

cluck 04-23-2003 01:55 PM

Quote:

Originally posted by punkworld
die() also works in php.
Man I should have tried that before sucking myself out of productivity world and into GFY world. I may never make it back :helpme

StupidNewbie 04-23-2003 01:57 PM

Quote:

Originally posted by Sin_Vraal



Die is an error should technically be exit(1), although nobody ever checks the return code anyway lol.

Don't be bitter ;)

he asked how to completely hault a script. You can have the present if you would like it.

TheFLY 04-23-2003 01:57 PM

pie

Babaganoosh 04-23-2003 01:59 PM

Quote:

Originally posted by TheFLY
pie


mmmmm piiieeee

gornyhuy 04-23-2003 02:02 PM

Where's the present?

StupidNewbie 04-23-2003 02:03 PM

I'm looking for a really top-notch PHP coder, please contact me at ICQ:157711456

thanks

PaulSweet 04-23-2003 03:05 PM

I sale short icq uin numbers?

Zyber 04-23-2003 03:08 PM

cluck, I think you should read more about how PHP works before writing a script

exit;
is so very basic - you might be missing other important commands / techniques.


:2 cents:

Sin_Vraal 04-23-2003 05:02 PM

Quote:

Originally posted by Sin_Vraal



Die is an error should technically be exit(1), although nobody ever checks the return code anyway lol.

Your right, although he DID ask how halt using die in his example.

So you dont just want to exit 0 out =)

Thorin 04-23-2003 05:27 PM

Programming classes & books are good things.


All times are GMT -7. The time now is 07:27 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123