Bug #70668 [Asn->Csd]: array_keys() doesn't respect references when $strict is true

From: Date: Thu, 08 Oct 2015 12:00:07 +0000
Subject: Bug #70668 [Asn->Csd]: array_keys() doesn't respect references when $strict is true
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196488@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70668&edit=1 ID: 70668 Updated by: dmitry@php.net Reported by: dmitry@php.net Summary: array_keys() doesn't respect references when $strict is true -Status: Assigned +Status: Closed Type: Bug Package: Arrays related Operating System: * PHP Version: 7.0Git-2015-10-08 (Git) Assigned To: dmitry Block user comment: N Private report: N New Comment: Automatic comment on behalf of dmitry@zend.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=3815e9713601a637b30bb99d631fc68df97f9288 Log: Fixed bug #70668 (array_keys() doesn't respect references when $strict is true) Previous Comments: ------------------------------------------------------------------------ [2015-10-08 11:51:54] dmitry@php.net Description: ------------ Comparison of references doesn't work properly when $strict argument is true. Test script: --------------- <?php $arr = array(1, "1", "", NULL, 0, false, true, array()); $s = &$arr[0]; var_dump(array_keys($arr, $s, true)); $s = &$arr[1]; var_dump(array_keys($arr, $s, true)); $s = &$arr[2]; var_dump(array_keys($arr, $s, true)); $s = &$arr[3]; var_dump(array_keys($arr, $s, true)); $s = &$arr[4]; var_dump(array_keys($arr, $s, true)); $s = &$arr[5]; var_dump(array_keys($arr, $s, true)); $s = &$arr[6]; var_dump(array_keys($arr, $s, true)); $s = &$arr[7]; var_dump(array_keys($arr, $s, true)); ?> Expected result: ---------------- array(1) { [0]=> int(0) } array(1) { [0]=> int(1) } array(1) { [0]=> int(2) } array(1) { [0]=> int(3) } array(1) { [0]=> int(4) } array(1) { [0]=> int(5) } array(1) { [0]=> int(6) } array(1) { [0]=> int(7) } Actual result: -------------- array(0) { } array(0) { } array(0) { } array(0) { } array(0) { } array(0) { } array(0) { } array(0) { } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70668&edit=1

« previous php.bugs (#196488) next »