When an assignment happens, PHP returns the value that was assigned.
So if you were to do
echo $a = 3; you would get
3 in the PHP out.
Another example from the same docs linked above:
$a = ($b = 4) + 5; // $a is equal to 9 now, and $b has been set to 4.
Simply put, it's desired behaviour in the context of the language and its documentation. Python doesn't adopt this behaviour.
Interestingly, I can also do this with other quite powerful programming languages. Here's Ruby:
vagrant@ubuntu-14:/vagrant$ irb 2.1.2 :001 > a = (b = 4) + 5 => 9 2.1.2 :002 > b => 4