Doc #55018 [Opn->Csd]: Missing semicolon from the end of the example script
| From: | rquadling@php.net | Date: | Thu, 09 Jun 2011 17:15:58 +0000 |
| Subject: | Doc #55018 [Opn->Csd]: Missing semicolon from the end of the example script | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6718@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=55018&edit=1
ID: 55018
Updated by: rquadling@php.net
Reported by: pgl at yoyo dot org
Summary: Missing semicolon from the end of the example script
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: rquadling
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2011-06-09 19:15:01] rquadling@php.net
Automatic comment from SVN on behalf of rquadling
Revision: http://svn.php.net/viewvc/?view=revision&revision=311978
Log: Missing ;
Fix bug#55018
------------------------------------------------------------------------
[2011-06-09 18:17:31] pgl at yoyo dot org
Description:
------------
---
From manual page: http://www.php.net/function.pcntl-signal#Examples
---
There is a missing semicolon from the end of the example script on the pcntl_signal man page.
This line specifically:
echo "Done\n"
needs ; at the end.
Test script:
---------------
<?php
// tick use required as of PHP 4.3.0
declare(ticks = 1);
// signal handler function
function sig_handler($signo)
{
switch ($signo) {
case SIGTERM:
// handle shutdown tasks
exit;
break;
case SIGHUP:
// handle restart tasks
break;
case SIGUSR1:
echo "Caught SIGUSR1...\n";
break;
default:
// handle all other signals
}
}
echo "Installing signal handler...\n";
// setup signal handlers
pcntl_signal(SIGTERM, "sig_handler");
pcntl_signal(SIGHUP, "sig_handler");
pcntl_signal(SIGUSR1, "sig_handler");
// or use an object, available as of PHP 4.3.0
// pcntl_signal(SIGUSR1, array($obj, "do_something");
echo"Generating signal SIGTERM to self...\n";
// send SIGUSR1 to current process id
posix_kill(posix_getpid(), SIGUSR1);
echo "Done\n"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=55018&edit=1