note 98249 deleted from language.types.boolean by danbrown
| From: | danbrown@php.net | Date: | Thu, 03 Jun 2010 23:09:21 +0000 |
| Subject: | note 98249 deleted from language.types.boolean by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-169875@lists.php.net to get a copy of this message | ||
Note Submitter: volleyballmaniac at gmail dot com
----
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.