RE: [PHP-NOTES] note 11729 added to get_class_vars
| From: | James Moore | Date: | Mon, 05 Mar 2001 00:12:12 +0000 |
| Subject: | RE: [PHP-NOTES] note 11729 added to get_class_vars | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-11851@lists.php.net to get a copy of this message | ||
this is what would be expected as $V1 is added to array but is then null so
doesnt appear in the array..
James
> -----Original Message-----
> From: php-general@lists.php.net [mailto:php-general@lists.php.net]
> Sent: 04 March 2001 23:52
> To: php-notes@lists.php.net
> Subject: [PHP-NOTES] note 11729 added to get_class_vars
>
>
> It seems there is a unsaid behaviour/bug in the get_class_vars().
> Try this one :
>
> class TestClass {
> var $V1;
> var $V2 = "Val_2";
> }
>
> get_class_vars("TestClass ") will return array("V2" => NULL), ie
> no traces of the "V1" class variable.
>
> So it seems that an uninitialised var in a class will not appear
> in the array returned by get_class_vars().
>
> http://www.php.net/manual/en/function.get-class-vars.php
>
>
> --
> PHP Notes Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-notes-unsubscribe@lists.php.net
> For additional commands, e-mail: php-notes-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net