#43334 [Opn->Csd]: isset behaviour with multiple parameters

From: Date: Wed, 21 Nov 2007 11:37:50 +0000
Subject: #43334 [Opn->Csd]: isset behaviour with multiple parameters
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-224@lists.php.net to get a copy of this message
ID: 43334 Updated by: vrana@php.net Reported By: nicholsr@php.net -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Irrelevant PHP Version: Irrelevant New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. "If multiple parameters are supplied then isset() will return TRUE only if all of the parameters are set. Evaluation goes from left to right and stop as soon as a set variable is encountered." Previous Comments: ------------------------------------------------------------------------ [2007-11-19 11:59:08] nicholsr@php.net Description: ------------ The documentation for isset does not clearly describe the behaviour for multiple parameters. I suggest that the "Description" is revised by adding the following: If multiple parameters are supplied then isset will return TRUE only if all of the parameters are not NULL or unset. I suggest that the "Notes" is revised by adding the following: "If multiple parameters are supplied then isset evaluates them in order left to right. It stops evaluating the parameters as soon as an unset parameter is encountered." Reproduce code: --------------- <?php echo "this generates a warning about b not being set \n"; var_dump (isset ($a[$b])); echo "this generates no warning \n"; var_dump (isset ($c, $a[$b])); ?> Expected result: ---------------- this generates a warning about b not being set PHP Notice: Undefined variable: b in C:\cygwin\home\nicholsr\1.php on line 3 bool(false) this generates no warning bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43334&edit=1

« previous php.doc.bugs (#224) next »