php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31961 undefined function array_intersect_key()
Submitted: 2005-02-13 22:22 UTC Modified: 2005-02-13 22:51 UTC
From: bart at mediawave dot nl Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 5.0.3 OS: WinXP
Private report: No CVE-ID: None
 [2005-02-13 22:22 UTC] bart at mediawave dot nl
Description:
------------
array_intersect_key() seems undefined.

Reproduce code:
---------------
<?php
$array1 = array('blue'  => 1, 'red'  => 2, 'green'  => 3, 'purple' => 4);
$array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan'  => 8);

var_dump(array_intersect_key($array1, $array2));
?> 

Expected result:
----------------
array(2) {
  ["blue"]=>
  int(1)
  ["green"]=>
  int(3)
})

Actual result:
--------------
Fatal error: Call to undefined function array_intersect_key() in D:\Inetpub\wwwroot\phpbugs\array_intersect_key.php on line 13

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-13 22:51 UTC] tony2001@php.net
array_diff_key(), array_diff_ukey(), array_intersect_key() &  array_intersect_ukey() were added only in 5.1.0.
 [2005-02-13 22:51 UTC] sniper@php.net
This functions exists only in CVS (HEAD, which will become PHP  5.1 sometime soonish)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 16:01:27 2024 UTC