Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is =& in PHP?

Tags:

operators

php

Look at this example. There is a line:

  $client =& new xmlrpc_client('/xml-rpc', 'api.quicktate.com', 80);
  $client->return_type = 'xmlrpcvals';

What is the =& and what does the -> in $client->return_type mean?

like image 603
Matt Elhotiby Avatar asked Sep 02 '10 20:09

Matt Elhotiby


1 Answers

The = and the & should* have a space between them - they're two different operators. The & means get a reference to this.

The -> is for object member access - this means assign 'xmlrpcvals' to the return_type member of $client.

* see comments for clarification

like image 186
Skilldrick Avatar answered Sep 30 '22 21:09

Skilldrick