note 109465 added to function.isset
| From: | kefirowocowy at ymail dot com | Date: | Thu, 19 Jul 2012 15:10:03 +0000 |
| Subject: | note 109465 added to function.isset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189298@lists.php.net to get a copy of this message | ||
Using pass-by-reference function can modify variable you pass.
If you gonna ask for array key which don't exist it will be created containing NULL.
Function don't even have to touch variable, it's done calltime.
Surprising but true.
PHP 5.3.2-1
<?php
function issetor(&$v){}
$a = array();
print_r($a);
issetor($a['key']);
print_r($a);
?>
Outputs
Array
(
)
Array
(
[key] =>
)
----
Server IP: 69.147.83.197
Probable Submitter: 93.159.33.200
----
Manual Page -- http://www.php.net/manual/en/function.isset.php
Edit -- https://master.php.net/note/edit/109465
Del: integrated -- https://master.php.net/note/delete/109465/integrated
Del: useless -- https://master.php.net/note/delete/109465/useless
Del: bad code -- https://master.php.net/note/delete/109465/bad+code
Del: spam -- https://master.php.net/note/delete/109465/spam
Del: non-english -- https://master.php.net/note/delete/109465/non-english
Del: in docs -- https://master.php.net/note/delete/109465/in+docs
Del: other reasons-- https://master.php.net/note/delete/109465
Reject -- https://master.php.net/note/reject/109465
Search -- https://master.php.net/manage/user-notes.php