php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51827 Bad warning when register_shutdown_function called with wrong num of parameters
Submitted: 2010-05-14 17:42 UTC Modified: 2010-05-15 01:49 UTC
From: andrew dot guertin at uvm dot edu Assigned: felipe
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.2 OS: Linux
Private report: No CVE-ID:
 [2010-05-14 17:42 UTC] andrew dot guertin at uvm dot edu
Description:
------------
When register_shutdown_function is called with a function that expects a certain number of parameters, and a different number are given, a very unhelpful warning is printed:

Warning: (null)() expects exactly 1 parameter, 0 given in Unknown on line 0

This can take slightly different forms:

Warning: (null)() expects at least 2 parameters, 1 given in Unknown on line 0

or on a different server:

Warning: Wrong parameter count for (null)() in Unknown on line 0

Test script:
---------------
<?php register_shutdown_function('explode'); ?>

Expected result:
----------------
I expect to be given the correct function name, filename, and line number in the warning.

Actual result:
--------------
I am given useless information for function name, filename, and line number.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-15 01:48 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=299395
Log: - Fixed bug #51827 (Bad warning when register_shutdown_function called with wrong num of parameters)
 [2010-05-15 01:48 UTC] felipe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2010-05-15 01:48 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2010-05-15 01:49 UTC] felipe@php.net
-Package: Unknown/Other Function +Package: Scripting Engine problem
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 10:02:06 2014 UTC