note 23104 deleted from function.get-class-vars by nlopess
| From: | nlopess@php.net | Date: | Fri, 24 Dec 2004 20:37:35 +0000 |
| Subject: | note 23104 deleted from function.get-class-vars by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-82277@lists.php.net to get a copy of this message | ||
Note Submitter: nick_eby at bonzidev dot com
----
Beginning with php 4.2.1, the given example is wrong because this function no longer ignores
uninitialized variables. Example:
<?
class MyTest {
var $classVar1 = 'Class Var 1';
var $classVar2;
}
echo "<pre>";
print_r( get_class_vars('MyTest'));
echo "</pre>";
?>
The output is:
Array
(
[classVar1] => Class Var 1
[classVar2] =>
)