Re: [PHP-DEV] Casting of objects to array exports private/protected data

2004-01-21 Thread Adam Maccabee Trachtenberg
On Wed, 21 Jan 2004, Andi Gutmans wrote: > In general, I think casting an object to an array sucks. > I would be all for an E_STRICT message that this is deprecated as we have > "real" objects now and IMO, and that... > ...the behavior might change/go away sometime in the future. Are you saying

Re: [PHP-DEV] Casting of objects to array exports private/protected data

2004-01-21 Thread Andi Gutmans
Yeah, because it used to work. Andi At 01:19 PM 1/21/2004 +0200, Jani Taskinen wrote: Why not simply make the cast not work? Can you think of any BC problem with that? :) --Jani On Wed, 21 Jan 2004, Andi Gutmans wrote: >In general, I think casting an object to an array sucks. >I wo

Re: [PHP-DEV] Casting of objects to array exports private/protected data

2004-01-21 Thread Jani Taskinen
Why not simply make the cast not work? Can you think of any BC problem with that? :) --Jani On Wed, 21 Jan 2004, Andi Gutmans wrote: >In general, I think casting an object to an array sucks. >I would be all for an E_STRICT message that this is deprecated as we have >"real"

Re: [PHP-DEV] Casting of objects to array exports private/protected data

2004-01-21 Thread Andi Gutmans
In general, I think casting an object to an array sucks. I would be all for an E_STRICT message that this is deprecated as we have "real" objects now and IMO, and that the behavior might change/go away sometime in the future. Andi At 05:07 PM 1/17/2004 +0100, Andrey Hristov wrote: Pierre-Alain

Re: [PHP-DEV] Casting of objects to array exports private/protected data

2004-01-17 Thread Andrey Hristov
Pierre-Alain Joye wrote: On Sat, 17 Jan 2004 16:44:29 +0100 Andrey Hristov <[EMAIL PROTECTED]> wrote: IMO, when casting to array with (array) only the public-ly visible members should returned. Dunno, E_STRICT (as you can access them without notice/warning without this flag)? In the same manner:

Re: [PHP-DEV] Casting of objects to array exports private/protected data

2004-01-17 Thread Pierre-Alain Joye
On Sat, 17 Jan 2004 16:44:29 +0100 Andrey Hristov <[EMAIL PROTECTED]> wrote: > IMO, when casting to array with (array) only the public-ly visible > members should returned. Dunno, E_STRICT (as you can access them without notice/warning without this flag)? In the same manner: dump(); ?> a var_d

[PHP-DEV] Casting of objects to array exports private/protected data

2004-01-17 Thread Andrey Hristov
Hi internals, casting an object to array gives the possibility to get the values of protected/private member variables : class some { public $pub = 1; protected $prot = 2; private $priv = 3; } var_dump((array)new some()); ?> Produces : array(3) { ["pub"]=> int(1) ["