php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #43334 isset behaviour with multiple parameters
Submitted: 2007-11-19 11:59 UTC Modified: 2007-11-22 15:46 UTC
From: nicholsr@php.net Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nicholsr@php.net
New email:
PHP Version: OS:

 

 [2007-11-19 11:59 UTC] 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)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-21 11:37 UTC] vrana@php.net
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."
 [2007-11-22 14:55 UTC] nicholsr@php.net
What was added to the documentation was this:

"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."

Unfortunately this is not quite right.

It should say:

"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 an unset variable is encountered."
 [2007-11-22 15:46 UTC] colder@php.net
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.

already fixed.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 20:00:02 2026 UTC