hi,
we are moving our site to a new server, asap.
this involves changing from PHP3 to PHP4.
alot of our classes initialise another class inside themselves.
this works fine in php3 but not in php4.
now it gives this..
Parse error: parse error in /test_class.php3 on line 18
the example code to test this is below.
is there a way round this or do i have to rewrite everything for 'extends class'.?
i'm going to rewrite the whole site in a few weeks, and i'm really just looking for a temporary fix.
thanks.
ross
----example code-----------------------------
<body>
Testing classes in php
<hr>
<?
class Test1
{
var $testVal;
function print1()
{
print "This is class test1 printing<br>";
}
}
class Test2
{
var $t1 = new Test1;// <-----line 18 causes error
function print2()
{
print "this is class test2 printing<br>";
$this->t1->print1();
}
}
$tt1 = new Test1;
$tt2 = new Test2;
$tt1->print1();
print "<hr>";
$tt2->print2();
?>
-------end code------------------