Bug #80352 [Opn->Nab]: Behaviour of array_intersect and array_intersect_key changed

From: Date: Thu, 12 Nov 2020 13:18:54 +0000
Subject: Bug #80352 [Opn->Nab]: Behaviour of array_intersect and array_intersect_key changed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230292@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80352&edit=1

 ID:                 80352
 Updated by:         nikic@php.net
 Reported by:        jelly dot legend at gmail dot com
 Summary:            Behaviour of array_intersect and array_intersect_key
                     changed
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            Arrays related
 PHP Version:        8.0.0RC4
 Block user comment: N
 Private report:     N

 New Comment:

See: https://github.com/php/php-src/blob/2875d0f9204122901f90072263e23e21a857b8a2/UPGRADING#L822-L829


Previous Comments:
------------------------------------------------------------------------
[2020-11-12 13:15:45] 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



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80352&edit=1


Thread (2 messages)

« previous php.bugs (#230292) next »