note 31843 added to function.pcntl-signal

From: Date: Tue, 06 May 2003 09:21:28 +0000
Subject: note 31843 added to function.pcntl-signal
Groups: php.notes 
Request: Send a blank email to php-notes+get-47574@lists.php.net to get a copy of this message
It seems like the scope of declare() when used in it's new global form e.g. declare(ticks = 1); is restricted to the file it is used in and the one's include() -ed or require() -ed by the script. So you can NOT do this: main.php: <?php include ('signals.php'); do_something_here(); ?> signals.php: <?php declare(ticks = 1); function sig_handler($signo) { handle_the_signal_here(); } pcntl_signal (SIGINT, 'sig_handler'); ?> Your signal handler function will not be called. In the above examples you have to declare() in the main.php file. -- http://www.php.net/manual/en/function.pcntl-signal.php http://master.php.net/manage/user-notes.php?action=edit+31843 http://master.php.net/manage/user-notes.php?action=delete+31843 http://master.php.net/manage/user-notes.php?action=reject+31843

« previous php.notes (#47574) next »