note 84765 added to function.isset
| From: | mandos78ATmailfromgoogle at osu1 dot php dot net | Date: | Tue, 29 Jul 2008 09:40:12 +0000 |
| Subject: | note 84765 added to function.isset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-142884@lists.php.net to get a copy of this message | ||
Careful with this function "ifsetfor" by soapergem, passing by reference means that if,
like the example $_GET['id'], the argument is an array index, it will be created in the
original array (with a null value), thus causing posible trouble with the following code. At least
in PHP 5.
For example:
<?php
$a = array();
print_r($a);
ifsetor($a["unsetindex"], 'default');
print_r($a);
?>
will print
Array
(
)
Array
(
[unsetindex] =>
)
Any foreach or similar will be different before and after the call.
----
Server IP: 130.206.1.5
Probable Submitter: 80.36.133.91
----
Manual Page -- http://www.php.net/manual/en/function.isset.php
Edit -- https://master.php.net/note/edit/84765
Del: integrated -- https://master.php.net/note/delete/84765/integrated
Del: useless -- https://master.php.net/note/delete/84765/useless
Del: bad code -- https://master.php.net/note/delete/84765/bad+code
Del: spam -- https://master.php.net/note/delete/84765/spam
Del: non-english -- https://master.php.net/note/delete/84765/non-english
Del: in docs -- https://master.php.net/note/delete/84765/in+docs
Del: other reasons-- https://master.php.net/note/delete/84765
Reject -- https://master.php.net/note/reject/84765
Search -- https://master.php.net/manage/user-notes.php