|
Posted by Rik Wasmus on 11/09/07 17:03
On Fri, 09 Nov 2007 17:55:46 +0100, otrWalter@gmail.com =
<otrWalter@gmail.com> wrote:
> I'm trying to display that type, name and value to class properties.
> Yes, I know about print_r().
>
> I'm just trying to build a display format for this information. AFAIK,=
> the standard PHP tools to look into classes do not give you PRIVATE
> and PROTECTED properties (nor methods), but the print_r() does! (At
> least for properties it does.)
>
> This this display below...
>
> // [this is a stored in a string variable]
> Vegetable Object
> (
> [edible:private] =3D> spinach
> [color:protected] =3D> green
> [size] =3D> 1
> )
>
> Now, I'd like to parse this string (above) into 3 arrays:
> 1) Public
> 2) Private
> 3) Protected
>
> Each having a list of variables names with their values, as so...
>
> array
> (
> [private] =3D> ([edible] =3D> spinach),
> [protected] =3D> ([color] =3D> green),
> [public] =3D> ([size] =3D> 1)
> }
>
> Any ideas?
Are you per chance looking for Reflection?
http://nl2.php.net/oop5.reflection
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|