Static variables are associated with the class, not with the object, so you would need to do something like:
<?php
class Base {
static $header;
function __construct() {
self::$header = true; // static vars referenced by class::$varname
}
}
class Child extends Base {
function __construct() {
self::$header = true; // need to set it to true if Base not instantiated
}
}
$template = new Child;
if(Child::$header) { // could as easily use Base::$header, instead
//this does not print
print 'header is defined';
}
?>