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.
@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?
@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.
@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?
@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.
@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.