php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #35175 Wrong parameter count warning should include docref urls
Submitted: 2005-11-09 21:36 UTC Modified: 2012-06-05 23:04 UTC
From: subscription at nazarenko dot net Assigned:
Status: Duplicate Package: Scripting Engine problem
PHP Version: * OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: subscription at nazarenko dot net
New email:
PHP Version: OS:

 

 [2005-11-09 21:36 UTC] subscription at nazarenko dot net
Description:
------------
When 'html_errors=On' and 'docref_root' and 'docref_ext' are set, not all warnings/errors become html links to the documentation.

It seems that the warnings about wrong function arguments do not generate html links, whereas failed function calls with the properly given arguments do so.

Reproduce code:
---------------
A fragment of php.ini:

error_reporting  =  E_ALL|E_STRICT
display_errors = On
html_errors = On
docref_root = "http://de.php.net/manual/en/"
docref_ext = ".php"


And then the test script:

<?php

str_replace('one','two');
mysqli_connect('fake');

?>

Produces this html:

<br />
<b>Warning</b>:  Wrong parameter count for str_replace() in <b>x.php</b> on line <b>3</b><br />

<br />
<b>Warning</b>:  mysqli_connect() [<a href='http://de.php.net/manual/en/function.mysqli-connect.php'>function.mysqli-connect.php</a>]: (HY000/2005): Unknown MySQL server host 'fake' (1) in <b>x.php</b> on line <b>4</b><br />


Expected result:
----------------
I think it would be MUCH more useful for a developer to get links to the documentation when there are inconsistencies in a function arguments (and such), rather than when the function call actually failed with the properly specified arguments.

When the function returns an error or warning it is often 'too late' to look into the documentation. On the other hand, very often an error is made in a number/order/type of function arguments, i.e. before the function is called, which is when the documentation is very handy.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-09 21:44 UTC] tony2001@php.net
This is not a bug, but a change request.
 [2011-01-02 02:24 UTC] jani@php.net
-Summary: Not all function names are changed to documentation links in error messages +Summary: Wrong parameter count warning should include docref urls -Package: Feature/Change Request +Package: Scripting Engine problem -Operating System: SuSE Linux 10.0 +Operating System: * -PHP Version: 5CVS-2005-11-09 (snap) +PHP Version: *
 [2012-06-05 23:04 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 [2012-06-05 23:04 UTC] nikic@php.net
Closing as duplicate of https://bugs.php.net/bug.php?id=32217.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 12:01:28 2024 UTC