Req #53448 [Com]: Syslog never returns false while a FALSE is documented in php manual

From: Date: Thu, 02 Dec 2010 11:03:29 +0000
Subject: Req #53448 [Com]: Syslog never returns false while a FALSE is documented in php manual
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-156690@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53448&edit=1 ID: 53448 Comment by: sskaje at gmail dot com Reported by: sskaje at gmail dot com Summary: Syslog never returns false while a FALSE is documented in php manual Status: Bogus Type: Feature/Change Request Package: Network related Operating System: Irrelevant PHP Version: Irrelevant Block user comment: N Private report: N New Comment: @johannes I reported as a feature requesting but not a bug. In php manual it documented a return value of FALSE, but in that file it RETURN_TRUE without checking if syslog()/std_syslog() works. I just want a RETURN_FALSE after checking the return value of 272 php_syslog(priority, "%s", message); Previous Comments: ------------------------------------------------------------------------ [2010-12-02 11:49:24] johannes@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Parsing parameters is a special case: "Note: If the parameters given to a function are not what it expects, such as passing an array where a string is expected, the return value of the function is undefined. In this case it will likely return NULL but this is just a convention, and cannot be relied upon." http://php.net/manual/en/functions.internal.php ------------------------------------------------------------------------ [2010-12-02 08:14:01] sskaje at gmail dot com Description: ------------ Sorry for the 'Package affected' select, network related is selected due to the syslog() in php manual in line 273 of ext/standard/syslog.c, i found following code: [code] 272 php_syslog(priority, "%s", message); 273 RETURN_TRUE; [/code] while in http://cn.php.net/syslog, it writes: [code] Return Values Returns TRUE on success or FALSE on failure. [/code] Another return value is null from : [code] 267 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &priority, 268 &message, &message_len) == FAILURE) { 269 return; 270 } [/code] null is returned only if there is a parameter error. Can your bring a FALSE returned by php's syslog(); Test script: --------------- null Expected result: ---------------- null Actual result: -------------- null ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53448&edit=1

« previous php.bugs (#156690) next »