Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS (http://www.linux-archive.org/centos/)
-   -   L9 - what is true? (http://www.linux-archive.org/centos/589183-l9-what-true.html)

Jussi Hirvi 10-19-2011 12:01 PM

L9 - what is true?
 
This code:

boolean(null); ', ';
boolean(string); ', ';
boolean(integer);', ';
boolean(array); ', ';
boolean(map); ', ';

gives:
false, false, false, true, true

This is different from L8. Is this intentional? If so, why?

This has consequences which I think are counterintuitive:

if(array(1) -> find('whatever'));

This evaluates as true.

- Jussi

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


All times are GMT. The time now is 11:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.