Current location: Hot Scripts Forums » Programming Languages » PHP » will die exit?


will die exit?

Reply
  #1 (permalink)  
Old 03-27-05, 07:32 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
will die exit?

Will die automatically exit or do I have to include the exit(); statement after?

die("Hack attempt");
exit();

??
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-27-05, 07:36 AM
hardcoded's Avatar
hardcoded hardcoded is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
it would have been faster to see for yourself than ask here.

die()
echo "foobar"
__________________
http://www.hardcoded.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 03-27-05, 10:36 AM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Agreed with hardcoded, but if you really want to make sure, you could check the manual if it's a question about a function itself:

http://jp2.php.net/die

It says "die -- Equivalent to exit()"
__________________
Blavv =|
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 03-27-05, 06:16 PM
moronovich moronovich is offline
Junior Code Guru
 
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
fyi, it's not like what most people imagine. because:
PHP Code:

print "Wrong params supplied";

exit();

<
binary data here
you'll notice the binary data being still executed.

regards,
__________________
just an ignorant noob with moronic solution...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 03-29-05, 06:39 AM
frank1965 frank1965 is offline
New Member
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
DIE does what it means! Your script dies immediate! No further statements are processed!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 03-29-05, 09:16 AM
moronovich moronovich is offline
Junior Code Guru
 
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by frank1965
DIE does what it means! Your script dies immediate! No further statements are processed!
oops, emotional answer. but it's not the actual reality. just a while ago, there was a patch to use __HALT_PHP_PARSER__ constant to terminate the parser.
Code:
Index: Zend/zend_language_scanner.l
===================================================================
RCS file: /repository/ZendEngine2/zend_language_scanner.l,v
retrieving revision 1.124
diff -u -r1.124 zend_language_scanner.l
--- Zend/zend_language_scanner.l	7 Mar 2005 16:48:49 -0000	1.124
+++ Zend/zend_language_scanner.l	11 Mar 2005 23:47:11 -0000
@@ -1342,6 +1342,13 @@
 	return T_INLINE_HTML;
 }
 
+<INITIAL>"<?php __HALT_PHP_PARSER__; ?>"{NEWLINE}? {
+	long fpos = (yyin ? zend_stream_ftell(yyin TSRMLS_CC): 0) + (long)(yy_c_buf_p - (YY_CURRENT_BUFFER)->yy_ch_buf);
+	REGISTER_MAIN_LONG_CONSTANT("__HALT_PHP_PARSER__", fpos, CONST_CS);
+
+	yyterminate();
+}
+
 <INITIAL>"<?"|"<script"{WHITESPACE}+"language"{WHITESPACE}*"="{WHITESPACE}*("php"|"\"php\""|"\'php\'"){WHITESPACE}*">" {
 	HANDLE_NEWLINES(yytext, yyleng);
 	if (CG(short_tags) || yyleng>2) { /* yyleng>2 means it's not <? but <script> */
__________________
just an ignorant noob with moronic solution...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hosting Account Until You DIE icanx General Advertisements 2 02-23-05 05:42 PM
Border Wont DIE! liljoeyjordison PHP 2 02-13-05 02:07 PM
Please Help me Get rid of this parse error gmjan6 PHP 5 06-19-04 01:48 AM
how to exit from keyboard input?? chaos7 Perl 5 05-03-04 05:10 AM
Exit ! OMID SOFT Visual Basic 3 04-27-04 06:43 PM


All times are GMT -5. The time now is 11:50 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.