[CentOS] L9 - what is a value
Jussi Hirvi
listmember at greenspot.fiMon Oct 17 12:57:53 UTC 2011
- Previous message: [CentOS] SORRY - L9 - what is a value
- Next message: [CentOS] CentOS-6 install on 1 Tb drive fails
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This code:
var('i') = string;
boolean($i); '<br>';
var('i') = array;
boolean($i); '<br>';
gives:
> false
> true
So an empty array gives "true" but an empty string "false".
This is different from L8. Is this intentional? If so, why?
This has consequences which I think are counterintuitive:
var('i') = array(1);
if($i -> find('whatever'));
i 'true'; '<br>';
$i -> find('whatever'); '<br>';
/if;
The if clause evaluates as true and gives as output:
true
array()
- Jussi
- Previous message: [CentOS] SORRY - L9 - what is a value
- Next message: [CentOS] CentOS-6 install on 1 Tb drive fails
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list