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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sskaje at gmail dot com
New email:
PHP Version: OS:

 

 [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-2019 The PHP Group
All rights reserved.
Last updated: Tue Sep 24 09:01:26 2019 UTC