note 102883 added to language.oop5.properties
| From: | Anonymous at osu1 dot php dot net | Date: | Sat, 12 Mar 2011 01:34:03 +0000 |
| Subject: | note 102883 added to language.oop5.properties | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-177813@lists.php.net to get a copy of this message | ||
To add to my comment "Anonymous 11-Mar-2011 11:18" about casting $this to array, this is
documented behavior when converting any object to an array (see
</language.types.array.php#language.types.array.casting> PHP manual page). All properties
regardless of visibility will be shown when casting an object to array (with exceptions of a few
built-in objects).
To get an array with all property names unaltered, use the 'get_object_vars($this)'
function in any method within class scope to retrieve an array of all properties regardless of
external visibility, or 'get_object_vars($object)' outside class scope to retrieve an
array of only public properties (see: </function.get-object-vars.php> PHP manual page).
----
Server IP: 69.147.83.197
Probable Submitter: 65.36.73.107
----
Manual Page -- http://www.php.net/manual/en/language.oop5.properties.php
Edit -- https://master.php.net/note/edit/102883
Del: integrated -- https://master.php.net/note/delete/102883/integrated
Del: useless -- https://master.php.net/note/delete/102883/useless
Del: bad code -- https://master.php.net/note/delete/102883/bad+code
Del: spam -- https://master.php.net/note/delete/102883/spam
Del: non-english -- https://master.php.net/note/delete/102883/non-english
Del: in docs -- https://master.php.net/note/delete/102883/in+docs
Del: other reasons-- https://master.php.net/note/delete/102883
Reject -- https://master.php.net/note/reject/102883
Search -- https://master.php.net/manage/user-notes.php