Re: Object to array conversion oddity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23 Sep 2006, at 16:37, Ray Hauge wrote:

Could you do something like this?

$private = "Myclass"
$protected = "*";

No, because if I have a property called 'Myclassfield1', after casting to an array I can't tell if it's private property called 'field1' or a public property called 'Myclassfield1'.

I think it's just plain wrong. Arrays should not try to be objects. You can find out protection level of a property via introspection of the object that you have in hand. In the vast majority of cases, you'll want it to act just like the docs say it does, and if you don't, you should probably be using the object itself anyway.

Bug report is here: http://bugs.php.net/?id=38935

Marcus
--
Marcus Bointon
Synchromedia Limited: Creators of http://www.smartmessages.net/
marcus@xxxxxxxxxxxxxxxxxx | http://www.synchromedia.co.uk/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux