11-30-2007, 07:04 PM
|
#5 (permalink)
|
|
The Wanderer
Join Date: Nov 2007
Posts: 14
Thanks: 1
|
No, Here's an example.
index.php
PHP Code:
<?php
require_once ( "class1.php" );
require_once ( "class2.php" );
$class1 = new class1;
$class2 = new class2 ( $class1 );
$class2->blah();
echo $class1->execute();
?>
class1.php
PHP Code:
<?php
class class1
{
var $data = "";
function execute()
{
return $this->data;
}
}
?>
class2.php
PHP Code:
<?php
class class2
{
var $class1 = "";
function class2 ( &$class1 )
{
$this->class1 = $class1;
}
function blah ()
{
$this->class1->data = "TESTING";
}
}
?>
Now on index.php it should echo TESTING right? But this doesn't appear to be working on a server i'm hosting the site on
|
|
|
|