Bug #80053 [Opn->Nab]: Undefined array key "12345"...

From: Date: Thu, 03 Sep 2020 20:43:49 +0000
Subject: Bug #80053 [Opn->Nab]: Undefined array key "12345"...
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228869@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80053&edit=1 ID: 80053 Updated by: requinix@php.net Reported by: cocnick2000 at gmail dot com Summary: Undefined array key "12345"... -Status: Open +Status: Not a bug Type: Bug Package: Session related Operating System: Windows 10 2004 64Bit PHP Version: 8.0.0beta3 Block user comment: N Private report: N New Comment: $row is not an array key. It is an array value. Your code was always broken. You also don't seem to know what session_unset() does. https://www.php.net/manual/en/function.session-unset.php Previous Comments: ------------------------------------------------------------------------ [2020-09-03 20:41:06] cocnick2000 at gmail dot com Description: ------------ on php7.4.9 i can unset my session array but on php8.0beta3 i get following error message: "...undefined error key..." Session: $_SESSION['tmp_image_access']['12345'] Test script: --------------- if (isset($_SESSION['tmp_image_access'])) foreach ($_SESSION['tmp_image_access'] as $row) { $this->db->query('UPDATE images SET username = ? WHERE token = ?', $this->data['username'], $row); session_unset($_SESSION['tmp_image_access'][$row]); } Expected result: ---------------- The session should be deleted with the token '12345' Actual result: -------------- i get the following error message on the page "...Undefined array key "12345"..." ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80053&edit=1

« previous php.bugs (#228869) next »