On Mon, 2005-10-03 at 09:49, Derick Rethans wrote:
> On Mon, 3 Oct 2005, Richard Mann wrote:
> 
> > Hmmm.... I agree about the reassigning of $this, but not the passing of
> > $this by ref.
> 
> Why are you passing an object be reference? Never heard that in PHP 5 
> objects are always references?

Amazing how fast the assumption has become that passing object values in
PHP5 is identical to passing the object by reference. It is not the
same, there are subtle differences. Either way I'm not weighing in on
the $ref = &$this issue, only that $obj = $someObj is NOT the same as
$obj = &$someObj.

<?php

class FooA{}
class FooB{}

$a = new FooA();
$b = new FooB();

$blah1 = &$a;
$blah2 = &$blah1;
$blah1 = $b;
print_r( $blah2 );

unset( $a, $b, $blah1, $blah2 );

$a = new FooA();
$b = new FooB();

$blah1 = $a;
$blah2 = $blah1;
$blah1 = $b;
print_r( $blah2 );

?>

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to