[SOLVED] static $property; not working as I think is suppose
Posted: Thu Jun 17, 2004 7:08 pm
I'm using php 5 and I'm having this problem and I'm not sure if I'm the one that's wrong or php is not doing what is supposed to:
Shouldn't it print second?
Am I wrong in assuming that it should print second?
Code: Select all
<?
class editor {
static $pages = 'first';
function __construct () {
$this->pages = 'second';
}
}
$test = new editor;
echo editor::$pages; // prints 'first'
?>Am I wrong in assuming that it should print second?