Here is an implementation of linked list. It's OK, it's working. But there are few lines that bother me (comments inside method are mine):
//insertion at the start of linklist
public function insertFirst($data)
{
$link = new ListNode($data); // create local variable
$link->next = $this->firstNode;
$this->firstNode = &$link; // and remember the reference to it in $this->firstNode
Edit: Let me analyse this method line by line: L1. We create a local variable: $link. L2. Doesn't matter. L3. In 'firstNode' property we save the reference to local variable.
OK, all clear. But at the end of this method the local variable ($link) will be destroyed. So in 'firstNode' we have a reference to non-existent variable. The place in memory where $link variable was stored is free now. PHP can store there something new. Isn't it?