7
votes

I know that it's creating a reference in other cases. But what happens here?

$crawler = &new MyCrawler();
2

2 Answers

7
votes

It creates an instance of MyCrawler and passes the reference for that instance into $crawler. In PHP5 this is assumed so the use of the & is deprecated.

See Object References (the Ampersand).

6
votes

That is deprecated per the PHP documentation