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
 [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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-12 13:18 UTC] nikic@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jan 27 21:03:35 2022 UTC