Hi,
do you have an idea, why the following code doesn't work with php4 any more
?
class MyClass1 {
var i=0;
var myObject;
function MyClass1 () {
myObject = new MyClass2;
}
function myFunction() {
...
}
}
class MyClass2 {
var x = 0.0;
function MyClass2 () {
}
}
function queryDB(&$resultSet) {
$obj = new MyClass1;
// query database
while (! not end of resultset) {
$obj->i = Field1;
$obj->myObject->x = Field2;
$resultSet[] = $obj;
}
}
...
queryDB($result);
for ($i = 0; $i < count($result); $i++) {
$obj = (object)$result[$i];
$obj->myFunction();
}
this causes a "Call to undefinied function myfunction() ...". var_dump($obj)
shows, that the data was retrieved correctly and that member-variables are
set.
Any idea, what's wrong with it ?
Peter