PHP Class Member Declarations

php oop

Tue Sep 30 09:27:00 -0700 2008

When declaring members of a class in PHP, only the most basic of value assignments may be immediately made.

private $var = 'test'; // will work

private $var2 = $var; // will not work
private $var3 = 'test'.'ing'; // will also not work

Members declared without a value assignment are implicitly considered NULL.

blog comments powered by Disqus