Hello,

On Tue, Jan 20, 2009 at 8:30 PM, Kenan R Sulayman
<kur...@kkooporation.de> wrote:
> Hi,
> I'd like to propose a new function: spl_class_vars / params / contents.
>
> Notice: I haven't figured out a name yet  Please help me find one.. :-)
>
> The function returns an array of the contents of the given class-object.
> The class-object parameter may be text or rather directly the object ( new
> foo() ).
>
> Example, while the function-name 'spl_class_contents' is being used :
> <?php
>        class foo {
>                public $data = array();
>                public $lastbit = null;
>                public $passive = null;
>                public static $bar = null;
>                public $foo = true;
>
>                public function registerCall ( $key, $call, $passive =
> false ) {
>                        return $this ->foo;
>                }
>
>                private static function bregisterCall ( $key, $call,
> $passive = false ) {
>                        return $this ->foo;
>                }
>        }
>        print_r ( spl_class_contents( 'foo' ) );
>        print_r ( spl_class_contents( new foo() ) );
> ?>
>
> Expected
> Ex. 1:
> <?php
>        print_r ( spl_class_contents( 'foo' ) );
> ?>
> should return the following array: ( print_r 'd, cause the returning value
> should be usable for other functions )
>
> Array
> (
>    [data] => Array
>        (
>            [0] => public
>            [1] => array
>        )
>    [lastbit] => Array
>        (
>            [0] => public
>            [1] => null
>        )
>    [passive] => Array
>        (
>            [0] => static
>            [1] => null
>        )
>    [foo] => Array
>        (
>            [0] => public
>            [1] => true
>        )
>    [registerCall] => Array
>        (
>            [0] => public
>            [function] => Array
>                (
>                    [0] => key
>                    [1] => call
>                    [passive] => false
>                )
>        )
> )
>
> Ex.2.
> Example 2 should return the same as the above example.

Why can't you use Reflection in this case? It looks like you can quite
easily implement that in userland from Reflection.

Regards

>
> Cheers,
> --
> (c) Kenan Sulayman
> Freelance Designer and Programmer
>
> Life's Live Poetry
>



-- 
Etienne Kneuss
http://www.colder.ch

Men never do evil so completely and cheerfully as
when they do it from a religious conviction.
-- Pascal

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to