bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SMTP class question

iFlash opened this issue · comments

In the SMTP class' send method, there is the following bit:

if (!$mock) {
	$socket=&$this->socket;
	$socket=@stream_socket_client($this->host.':'.$this->port,
		$errno,$errstr,ini_get('default_socket_timeout'),
		STREAM_CLIENT_CONNECT,$this->context);
		...
		...

What is the question?

That's odd – there used to be a question which was:

$socket is assigned a value and then, in the next line, assigned the result of the stream_socket_client call. What I don't understand: Why assign it the address of this->socket first if it's not used? Maybe my understanding lacks here, sorry.

commented

What is the question?

It got edited out.

image

image

The first assignment sets the variable as a reference to this->socket and the following assignment sets a new variable content (to both).