View Single Post
Old 12-01-2007, 12:14 AM   #9 (permalink)
bluesaga
Super Moderator
Advanced Programmer 
 
bluesaga's Avatar
 
Join Date: Sep 2007
Posts: 165
Thanks: 0
bluesaga is on a distinguished road
Default

Pre-PHP 5 when you refer to a class in a function call, without using the ampersand operator then PHP would clone the class and not simply pass a reference as you are hoping for.

your code:
PHP Code:
<?php
require_once ( "class1.php" );
require_once ( 
"class2.php" );

$class1 = new class1;
$class2 = new class2 $class1 );

$class2->blah();

echo 
$class1->execute();

?>
Should be:
PHP Code:
$class2 = new class2 ( &$class1 ); 
__________________
Halo 3 Cheats
bluesaga is offline  
Reply With Quote