note 30978 added to language.oop
| From: | rjkaes at flarenet dot com | Date: | Sat, 05 Apr 2003 02:30:53 +0000 |
| Subject: | note 30978 added to language.oop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46245@lists.php.net to get a copy of this message | ||
The note and example indicates that arrays cannot be used to initialize class variables, but
I've used the following code without a problem:
class Foo {
function print_field($n)
{
print $this->_fields[$n];
}
var $_fields = array('field1', 'field2', 'field3');
}
$foo = new Foo;
$foo->print_field(1);
Perhaps the note/example in the documentation needs to be clarified.
--
http://www.php.net/manual/en/language.oop.php
http://master.php.net/manage/user-notes.php?action=edit+30978
http://master.php.net/manage/user-notes.php?action=delete+30978
http://master.php.net/manage/user-notes.php?action=reject+30978