Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP class question #1277

Open
iFlash opened this issue Jan 24, 2024 · 4 comments
Open

SMTP class question #1277

iFlash opened this issue Jan 24, 2024 · 4 comments

Comments

@iFlash
Copy link

iFlash commented Jan 24, 2024

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);
		...
		...

@ikkez
Copy link
Collaborator

ikkez commented Jan 30, 2024

What is the question?

@iFlash
Copy link
Author

iFlash commented Jan 30, 2024

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.

@pauljherring
Copy link

What is the question?

It got edited out.

image

image

@KOTRET
Copy link
Collaborator

KOTRET commented Jan 31, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants