php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63252 missing option
Submitted: 2012-10-10 11:28 UTC Modified: 2013-03-28 06:08 UTC
Votes:2
Avg. Score:2.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: juraj dot bocinec at lain dot sk Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Debian
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: juraj dot bocinec at lain dot sk
New email:
PHP Version: OS:

 

 [2012-10-10 11:28 UTC] juraj dot bocinec at lain dot sk
Description:
------------
php function rrd_graph is missing description of the "count" parameter, that seems to be mandatory:

Warning: Wrong parameter count for rrd_graph() in /u01/storage/html/graph.php on line 25

---
From manual page: http://www.php.net/function.rrd-graph
---


Test script:
---------------
irrelevant, documentation error

Expected result:
----------------
irrelevant, documentation error

Actual result:
--------------
irrelevant, documentation error

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-24 21:34 UTC] lonny at lonnylot dot com
I don't believe that message is that there is a missing "count" parameter. I 
believe It is saying that the number of parameters passed into rrd_graph is wrong.

Though, I am also not seeing where this error is thrown from called from 
rrd_graph.

Please provide a short test script so we can see what is causing this warning to 
be thrown.
 [2012-11-26 12:54 UTC] juraj dot bocinec at lain dot sk
greetings, to me it seems as mandatory because if i omit it, i will get
the error message, here is the sample function from code, i've commented
out the "working" code

function cgraphvg($source, $output, $start, $title) {
$RRD="/u01/storage/rrd/$source.rrd";
$options = array(
        "--start", $start,
        "--title=$title",
        "--lower-limit=0",
        "-w 600",
        "-h 300",
        "-X 0",
        "DEF:a=$RRD:usedvg:AVERAGE",
        "DEF:b=$RRD:freevg:AVERAGE",
        "AREA:a#0000ff:used GB in VG",
        "STACK:b#00ff00:free GB in VG"
);

#$ret=rrd_graph("/u01/storage/html/$output", $options,
count($options));
$ret=rrd_graph("/u01/storage/html/$output", $options);
if(! $ret) {
echo "Graph error:".rrd_error();
}
}

it's hard to debug as the rrd_error() function doesn't return any
relevant error (the output is empty)

Warning: Wrong parameter count for rrd_graph() in
/u01/storage/html/graph.php on line 26
Graph error:
 [2013-01-31 13:46 UTC] narf at bofh dot bg
The example shows that a parameter is indeed missing, though I doubt that it should represent a count of something.

@lonny is right - this warning describes that the count (number) of parameters passed to the function is wrong.
 [2013-03-27 15:02 UTC] juraj dot bocinec at lain dot sk
i'm not complaining about the function itself, just the way it's documented, the count option is not mentioned in documentation but if you don't use it in the script, it will print out the warning and fail
i don't know how to explain this more clearly sorry :)
 [2013-03-27 15:16 UTC] salathe@php.net
There is no "count" parameter for rrd_graph(), and never has been.

The function expects exactly (no more, no less!) two parameters:
1. The filename
2. An array of options

The error message in the original bug report was misread. The error message was 
complaining that an incorrect number of parameters (i.e, not 2) were passed to 
the function.
 [2013-03-27 15:16 UTC] salathe@php.net
-Status: Open +Status: Not a bug
 [2013-03-28 00:10 UTC] juraj dot bocinec at lain dot sk
then why does the code work with the count parameter? if i omit it, it will 
produce the warning, that means without the parameter that was never there it 
doesn't work

in this way to me it seems it takes exactly 3, not 2 parameters:
1. filename
2. array of options
3. count of options in the array

perhaps it has been added in some later implementation of the function and the 
documentation refers to older version? i don't know but currently it doesn't 
work the way it's described (at least for me :)
 [2013-03-28 06:08 UTC] salathe@php.net
Are you definitely using the PECL rrd_graph() function? From a quick scan of the 
history of that function, it never accepted a third parameter.
 [2013-03-28 10:09 UTC] juraj dot bocinec at lain dot sk
it seems you hit the nail on the head, the package installed here is from Debian repository and is part of rrdtool archive, not php extensions
i didn't realize there may be more packages doing the same thing
 [2013-03-28 10:19 UTC] juraj dot bocinec at lain dot sk
i have found an article that describes the old deprecated rrdtool php functions, it might be helpful as reference for someone who gets confused as me: http://mike.eire.ca/2010/03/28/using-rrdtool-with-php/
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 04:00:02 2026 UTC