Jump to content

[SOLVED] Halting the PHP execution process


Xu Wei Jie

Recommended Posts

Is there any command in PHP that will halt the execution process of an application?

 

I wish to implement a debug function thus this function will print out a debugging message and stop or continue the execution process based on an expression that is evaluated to true or false.

 

Would appreciate any help from all of you. =)

If you want to pause execution for a specific amount of time, you can use sleep(). If you want to halt execution, you can use exit.

 

 

http://php.net/sleep

http://php.net/exit

 

 

(Exit is a construct, so it can be used like 'exit;', but it's also valid to use something like exit('This message would be output right before script execution is halted.');)

Thanks. I need an idea on how to halt an entire application because exit only halt a particular execution process.

 

Basically my application invokes system() recursively within the scripts (i.e. system("php xxx.php",$retval); ) Thus if I invoke exit, it may only halt one particular execution process but not the entire application.

 

Any idea here? =)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.