Hello,
I was working on an object oriented application when I ran into a problem with this code:
<?php
class myClass
{
var $myObj = new otherClass;
...
}
?>
which throws an error on the var $myObj line. If it is written like this it works fine:
<?php
class myClass
{
var $myObj;
function myClass()
{
$this->myObj = new otherClass;
}
}
?>
Any idea why I cant instantiate another object as in example 1?
Thanks in advance for any ideas.
Jon Gale