note 98249 added to language.types.boolean
| From: | volleyballmaniac at gmail dot com | Date: | Thu, 03 Jun 2010 23:06:47 +0000 |
| Subject: | note 98249 added to language.types.boolean | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169873@lists.php.net to get a copy of this message | ||
I encountered an issue when using BOOLEAN settings within an array
function($args =''){
$defaults = array
(
, 'list_on' => FALSE
, 'before' => TRUE
);
$r = wp_parse_args( $args, $defaults );
.................
}
For some reason, when I had a bunch of args in the array, I couldn't get it to return FALSE
when using an IF statement:
if($r['list_on'] == FALSE { code }
This was fixed, by using integers instead:
, 'list_on' => 0
, 'before' => 1
I'm unsure why, but it would appear Boolean has some issues when being used within an array.
----
Server IP: 69.147.83.197
Probable Submitter: 98.160.234.165
----
Manual Page -- http://www.php.net/manual/en/language.types.boolean.php
Edit -- https://master.php.net/note/edit/98249
Del: integrated -- https://master.php.net/note/delete/98249/integrated
Del: useless -- https://master.php.net/note/delete/98249/useless
Del: bad code -- https://master.php.net/note/delete/98249/bad+code
Del: spam -- https://master.php.net/note/delete/98249/spam
Del: non-english -- https://master.php.net/note/delete/98249/non-english
Del: in docs -- https://master.php.net/note/delete/98249/in+docs
Del: other reasons-- https://master.php.net/note/delete/98249
Reject -- https://master.php.net/note/reject/98249
Search -- https://master.php.net/manage/user-notes.php