Jump to content
php.lv forumi

Ko lietojam pēc header();?


Recommended Posts

Labdien, radās vienkārša sportiska interese. Kādas zālītes lietojam pēc header(); funkcijas izpildes? die();, vai exit; narkotiku?

Link to comment
Share on other sites

die ir exit ekvivalents



Cik sapratu, tad die atgriež paziņojumu iekavās un izbeidz skriptu ar izejas kodu 0, bet ar pašu exit var norādīt vajadzīgo kodu, gan ziņojumu.


(ja laiž no konsoles, noder zināt, ar kādu izejas kodu programma nosprāga)


EDIT: vēl kaut kādi domu graudi: die doesn't prevent destructors from being run, so the script doesn't exit immediately, it still goes through cleanup routines.

Edited by briedis
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...