On 5 May 2010 22:14, Michael Shadle <[email protected]> wrote:
> -snip-
>
> Ahhhh. I gotcha now. Yeah I started using that just recently either
> 5.2.11 or 5.2.13 (not sure which)
>
> You can typecast an object to an array that easily? I was unaware.
>
Yep, it's that easy. :-)
// array(1) {
// [0]=>
// int(1)
// }
var_dump((array)1);
// array(1) {
// [0]=>
// string(1) "a"
// }
var_dump((array)'a');
// array(1) {
// ["c"]=>
// string(1) "d"
// }
class b {
public $c = 'd';
}
var_dump((array)new b());
Michiel