I have a class which contains (1) a class variable and (2) a method
(e.g., methodA) which returns a reference to the class variable. If
the variable has been assigned a value by a constant initializer in
the "var" statement, my httpd process crashes with a segmentation
fault when I call methodA. If the variable is assigned a value in one
of the class methods, the httpd process does not crash when methodA is
called and the value returned is the expected value. This is true
even if the variable was first initialized in the "var" statement, as
long as its value is subsequently set in a class method.
Fails:
class C {
var $v = "hello";
function C () {
}
function &methodA () {
return ($this->v);
}
}
Succeeds:
class C {
var $v = "hello";
function C () {
$this->v = "hello";
}
function &methodA () {
return ($this->v);
}
}
(Please note that my test case is too complicated to post. I included
the above examples to illustrate my point, but have not tested them.)
Has anyone else seen this behavior? Any insight would be appreciated.
(e.g., methodA) which returns a reference to the class variable. If
the variable has been assigned a value by a constant initializer in
the "var" statement, my httpd process crashes with a segmentation
fault when I call methodA. If the variable is assigned a value in one
of the class methods, the httpd process does not crash when methodA is
called and the value returned is the expected value. This is true
even if the variable was first initialized in the "var" statement, as
long as its value is subsequently set in a class method.
Fails:
class C {
var $v = "hello";
function C () {
}
function &methodA () {
return ($this->v);
}
}
Succeeds:
class C {
var $v = "hello";
function C () {
$this->v = "hello";
}
function &methodA () {
return ($this->v);
}
}
(Please note that my test case is too complicated to post. I included
the above examples to illustrate my point, but have not tested them.)
Has anyone else seen this behavior? Any insight would be appreciated.
Comment