note 89651 added to function.isset

From: Date: Wed, 18 Mar 2009 08:30:02 +0000
Subject: note 89651 added to function.isset
Groups: php.notes 
Request: Send a blank email to php-notes+get-152069@lists.php.net to get a copy of this message
just following what edsko said, it is very amazing when you use isset to check a string. look at what i found: [yarco@localhost ~]$ php -a Interactive shell php > $abc = 'test'; php > print isset($abc['e']) ? 'yes' : 'no'; yes php > print isset($abc['d']) ? 'yes' : 'no'; yes php > print isset($abc['aaaaaaa']) ? 'yes' : 'no'; yes php > print isset($abc[23]) ? 'yes' : 'no'; no If you use string as index, isset would always return true. (but i don't think it should return true) ---- Server IP: 222.73.227.205 Probable Submitter: 116.233.197.246 ---- Manual Page -- http://www.php.net/manual/en/function.isset.php Edit -- https://master.php.net/note/edit/89651 Del: integrated -- https://master.php.net/note/delete/89651/integrated Del: useless -- https://master.php.net/note/delete/89651/useless Del: bad code -- https://master.php.net/note/delete/89651/bad+code Del: spam -- https://master.php.net/note/delete/89651/spam Del: non-english -- https://master.php.net/note/delete/89651/non-english Del: in docs -- https://master.php.net/note/delete/89651/in+docs Del: other reasons-- https://master.php.net/note/delete/89651 Reject -- https://master.php.net/note/reject/89651 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#152069) next »