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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kraghuba at in dot ibm dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 07:01:33 2025 UTC