php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43197 array_intersect_assoc() does not emit warning messages for error inputs
Submitted: 2007-11-05 12:58 UTC Modified: 2007-11-05 23:55 UTC
From: kraghuba at in dot ibm dot com Assigned:
Status: Closed Package: Arrays related
PHP Version: 5.3CVS-2007-11-05 (snap) OS: Linux, windows
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:
48 - 27 = ?
Subscribe to this entry?

 
 [2007-11-05 12:58 UTC] kraghuba at in dot ibm dot com
Description:
------------
array_intersect_assoc() doesn't produce warning message when incorrect number of arguments are passed (i.e. Zero argument or one less than expected number of arguments).

This problem is applicable to php5.3 and php6 only. On php5 it generates  correct warning message.


Reproduce code:
---------------
<?php
$arr = array(1, 2, 3, 4);
var_dump( array_intersect_assoc() );
var_dump( array_intersect_assoc($arr) );
?>

Expected result:
----------------
Warning: array_intersect_assoc(): at least 2 parameters are required, 0 given in %s on line %d
NULL

Warning: array_intersect_assoc(): at least 2 parameters are required, 1 given in %s on line %d
NULL

Actual result:
--------------
NULL
NULL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-05 23:55 UTC] iliaa@php.net
This bug has been fixed in CVS.

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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 01:01:30 2024 UTC