note 96972 added to function.is-string

From: Date: Thu, 25 Mar 2010 14:25:51 +0000
Subject: note 96972 added to function.is-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-167387@lists.php.net to get a copy of this message
To son9ne dot junk at gmail dot com: You're switching on $var, not on true, which would make your code return 'string' as expected (try is_string('')). Switch makes a loose comparison between the condition and the case. In your code, $var === '' and is_array($var) === false, and false == ''. ---- Server IP: 87.124.86.46 Probable Submitter: 193.36.79.207 ---- Manual Page -- http://www.php.net/manual/en/function.is-string.php Edit -- https://master.php.net/note/edit/96972 Del: integrated -- https://master.php.net/note/delete/96972/integrated Del: useless -- https://master.php.net/note/delete/96972/useless Del: bad code -- https://master.php.net/note/delete/96972/bad+code Del: spam -- https://master.php.net/note/delete/96972/spam Del: non-english -- https://master.php.net/note/delete/96972/non-english Del: in docs -- https://master.php.net/note/delete/96972/in+docs Del: other reasons-- https://master.php.net/note/delete/96972 Reject -- https://master.php.net/note/reject/96972 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#167387) next »