php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #53448 Syslog never returns false while a FALSE is documented in php manual
Submitted: 2010-12-02 08:14 UTC Modified: 2010-12-02 11:49 UTC
From: sskaje at gmail dot com Assigned:
Status: Not a bug Package: Network related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
47 - 1 = ?
Subscribe to this entry?

 
 [2010-12-02 08:14 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-02 11:49 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2010-12-02 11:49 UTC] 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 12:03 UTC] sskaje at gmail dot com
@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);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC