Para agregar a la otra respuesta.
$a = $b = $c = $d
realmente significa $a = ( $b = ( $c = $d ) )
PHP pasa tipos primitivos int, string, etc.
por valor y objetos por referencia por defecto.
Eso significa
$c = 1234;
$a = $b = $c;
$c = 5678;
//$a and $b = 1234; $c = 5678;
$c = new Object();
$c->property = 1234;
$a = $b = $c;
$c->property = 5678;
// $a,b,c->property = 5678 because they are all referenced to same variable
Sin embargo, también PUEDE pasar objetos por valor, usando palabras clave clone
, pero tendrá que usar paréntesis.
$c = new Object();
$c->property = 1234;
$a = clone ($b = clone $c);
$c->property = 5678;
// $a,b->property = 1234; c->property = 5678 because they are cloned
PERO, NO PUEDE pasar tipos primitivos por referencia con palabra clave &
usando este método
$c = 1234;
$a = $b = &$c; // no syntax error
// $a is passed by value. $b is passed by reference of $c
$a = &$b = &$c; // syntax error
$a = &($b = &$c); // $b = &$c is okay.
// but $a = &(...) is error because you can not pass by reference on value (you need variable)
// You will have to do manually
$b = &$c;
$a = &$b;
etc.