Re: [SMARTY-DEV] html_options
| From: | messju mohr | Date: | Mon, 26 Feb 2007 13:56:09 +0000 |
| Subject: | Re: [SMARTY-DEV] html_options | ||
| References: | 1 2 3 4 5 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2974@lists.php.net to get a copy of this message | ||
On Mon, Feb 26, 2007 at 02:47:44PM +0100, Danilo Buerger wrote:
>
>
> messju mohr schrieb:
> >On Mon, Feb 26, 2007 at 01:44:58PM +0100, Danilo Buerger wrote:
> >[...]
> >>From
> >>http://de2.php.net/manual/en/language.types.array.php:
> >>"Using TRUE as a key will evaluate to integer 1 as key. Using FALSE as
> >>a key will evaluate to integer 0 as key."
> >>This clearly allows the use of boolean values as array keys.
> >
> >No it doesn't. It clearly says that it casts (and thus breaks) the keys.
> >
>
> It doesnt break anything:
>
> $test = array(true => 'foo', false => 'bar');
> var_dump($test[true]);
> var_dump($test[false]);
>
> If it says in the manual that i can use booleans as array keys, it is
> supported by php.
php -r '$a = array(true => "foo"); reset($a); var_dump(key($a));'
if booleans where supported as array-keys this would give
"bool(true)" but it gives "int(1)".
> We might want to ask internals@ though to get a definite answer.