I am correcting myself...

<?PHP
class foo {}

$oObjectA = array();
$oObjectB = array();

for($i=0;$i<2;$i++) {
   $oObjectA[$i] = new foo();
   $oObjectB[$i] = $oObjectA[$i];
}

unset($oObjectA[1]);

var_dump($oObjectA);
var_dump($oObjectB);
?>

will output:

array(1) {
  [0]=>
  object(foo)#1 (0) {
  }
}
array(2) {
  [0]=>
  object(foo)#1 (0) {
  }
  [1]=>
  object(foo)#2 (0) {
  }
}

So my question is, how do I destroy the object $oObjectA[1] in both arrays?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to