So, in the pass by reference talk, it was pointed out that if you do:

$a = 100;
$b = 100;
// At this point in time, $a and $b are still using the same memory to store their data
$b=50;
// Now b is assigned it's own memory area since it changed the data

How does this work with objects?  For example:

$a->foo = "Foo";
$a->foobar = "Foobar";

$b = $a;
// at this point in time, their using the same memory location for their variables

$b->foobar="New Foobar";
// Is the entire object for $b copied to a new memory location, or is just $b->foobar given it's own memory?
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to