php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80352 Behaviour of array_intersect and array_intersect_key changed
Submitted: 2020-11-12 13:15 UTC Modified: 2020-11-12 13:18 UTC
From: jelly dot legend at gmail dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 8.0.0RC4 OS:
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: jelly dot legend at gmail dot com
New email:
PHP Version: OS:

 

 [2020-11-12 13:15 UTC] jelly dot legend at gmail dot com
Description:
------------
PHP 8.0.0a promoted the warning if passing invalid number of arrays to array_intersect(_key) was promoted to a fatal error. However, it seem that something changed in the version 8.0.0b4 since no error is produced.


https://3v4l.org/qkAt5


Test script:
---------------
<?php

$arrayArray = [
    [1],[2]
];

array_intersect_key(...$arrayArray);// array_intersect

$arrayArray = [
    [1]
];

array_intersect_key(...$arrayArray);// array_intersect


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-12 13:18 UTC] nikic@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun May 11 18:01:27 2025 UTC