Bug #74108 [Opn->Nab]: Function list() and []

From: Date: Thu, 16 Feb 2017 15:39:12 +0000
Subject: Bug #74108 [Opn->Nab]: Function list() and []
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207413@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74108&edit=1 ID: 74108 Updated by: requinix@php.net Reported by: namonexarap at gmail dot com Summary: Function list() and [] -Status: Open +Status: Not a bug Type: Bug Package: *General Issues Operating System: Windows 7 SP 1 32-bit PHP Version: 7.1.1 Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php http://php.net/manual/en/function.list.php > Note: > list() only works on numerical arrays and assumes the numerical indices start at 0. Previous Comments: ------------------------------------------------------------------------ [2017-02-16 12:56:45] namonexarap at gmail dot com Description: ------------ Why does it work in this case: ------------------------------ $money = array (0 => 11000, 1 => 5500, 2 => 1500); [$D, $Ol, $Od] = $money; echo $D; ------------------------------ But doesn`t work in this case: ------------------------------ $money = array (5 => 11000, 6 => 5500, 7 => 1500); [$D, $Ol, $Od] = $money; echo $D; ------------------------------ Test script: --------------- $money = array (5 => 11000, 6 => 5500, 7 => 1500); [$D, $Ol, $Od] = $money; echo $D; Expected result: ---------------- 11000 Actual result: -------------- null ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74108&edit=1

« previous php.bugs (#207413) next »