/    Sign up×
Community /Pin to ProfileBookmark

script shutdown

Hi everyone, is there a way to get the last line of the script executed before the script shutdown is triggered? Ive spent 4 hours searching the web but to no avail. Any info or suggestions will be greatly appreciated. Thanks in advance.

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@TJ111Oct 24.2007 — I don't understand exactly what you asking. As long as the script is executing it should not "shut down" before the last line. Are you asking how to prevent php from outputting the results after the code has finished executing?
Copy linkTweet thisAlerts:
@NaldzauthorOct 24.2007 — Thaks for the reply. What i meant was i need to get the line the caused the script execution to end. Example, if an exit was invoked, i want to get the line where that exit construct was invoked. I usually use debug_backtrace to do this but it seems that it is not available if you register a function through the register_shutdown_function.
Copy linkTweet thisAlerts:
@TJ111Oct 24.2007 — If this for debugging purposes? Once you invoke register_shutdown_function no more output is sent to the browser, and I think this includes things like die("line 18"), but I'm not 100% on that. What exactly are you trying to accomplish? Are you trying using this when the connection is aborted or the script times out, or just at the end of normal execution?
Copy linkTweet thisAlerts:
@NaldzauthorOct 24.2007 — Sort of this is for debugging purposes. I just need to know what line, file was executed before the script ended. Is this possible? Thanks again.
Copy linkTweet thisAlerts:
@TJ111Oct 24.2007 — I'm not sure exactly. I use PhpED so I would just run it in the debugger and step through the code. You should consider getting a debugger, I bet theres some free or open source ones available if you don't want to buy one. Alternatively, the only other thing I can think of is have to shutdown scripts put information into a database or file regarding whatever information you need to know. Sorry I can't be of more help.
Copy linkTweet thisAlerts:
@NaldzauthorOct 24.2007 — Thanks again for your help. I appreciate it.
×

Success!

Help @Naldz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...