|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-04-02 00:03 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 20:00:01 2025 UTC |
Description: ------------ I was evaluating a variable with isset. I don't know what kind of variable it is before evaluating. If I do a isset of a key of an array, and the variable is NOT an array, I receive a true response. I think this is not a good result. Reproduce code: --------------- function verify($var) { if (isset($var['key'])) { echo "OK"; } else { echo "NO"; } return; } verify ('asdfghjkl'); verify (array('key'=>'1', 'option'=>'2'); verify (array('action'=>'1', 'option'=>'2'); Expected result: ---------------- ## verify ('asdfghjkl'); NO ## verify (array('key'=>'1', 'option'=>'2'); OK ## verify (array('action'=>'1', 'option'=>'2'); NO Actual result: -------------- ## verify ('asdfghjkl'); OK ## verify (array('key'=>'1', 'option'=>'2'); OK ## verify (array('action'=>'1', 'option'=>'2'); NO